Copy link to clipboard
Copied
Hey Everyone,
I have built a interactive form that has 10 fields (Advancement Drive, Drive to Excel, Development Commitment, People Agility, Mental Agility, Change Agility, Self Awareness, Performance, Company9, Leadersihp) and 30 radio buttons total. Each of the 10 fields is given 3 radio buttons, valued (1,2 or 3) and totaled at the bottom in a "Score" field in the calculation and then displays text in the "Potential Rating" field. It will show either (Grow With Role, Promotable, or High Potential). What I am struggling with is if (Advancement Drive, Drive to Excel, Development Commitment) are individually selected with the value of 1 then the potential rating text needs to display "Grow With Role" no matter what the total calculation sum ends up totaling. If they don't have any of those 3 fields at value 1 then it should calculate the total sum as normal. Is this possible to do?
Copy link to clipboard
Copied
Can you share file or let us know names of radio buttons?
EDIT:
var ad = this.getField("Advancement Drive").valueAsString;
var de = this.getField("Drive to Excel").valueAsString;
var dc = this.getField("Development Commitment").valueAsString;
var sum = Number(this.getField("Score").valueAsString);
if(sum){
if(ad=="AD1"&&de=="DE1"&&dc=="DC1")
event.value = "Grow With Role";
else if(sum <= 17)
event.value = "Grow With Role";
else if((sum <= 22) && (sum >=17))
event.value = "Promotable";
else if(sum >= 23)
event.value = "High Potential";}
else
event.value = "";
Copy link to clipboard
Copied
Can you share file or let us know names of radio buttons?
EDIT:
var ad = this.getField("Advancement Drive").valueAsString;
var de = this.getField("Drive to Excel").valueAsString;
var dc = this.getField("Development Commitment").valueAsString;
var sum = Number(this.getField("Score").valueAsString);
if(sum){
if(ad=="AD1"&&de=="DE1"&&dc=="DC1")
event.value = "Grow With Role";
else if(sum <= 17)
event.value = "Grow With Role";
else if((sum <= 22) && (sum >=17))
event.value = "Promotable";
else if(sum >= 23)
event.value = "High Potential";}
else
event.value = "";
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Check my post above I changed script, try and see if it works for you.
Copy link to clipboard
Copied
Thank you! I made a small change ( or v. and) and it seem working great!
var ad = this.getField("Advancement Drive").valueAsString;
var de = this.getField("Drive to Excel").valueAsString;
var dc = this.getField("Development Commitment").valueAsString;
var sum = Number(this.getField("Score").valueAsString);
if(sum){
if(ad=="AD1"|| de=="DE1" || dc=="DC1")
event.value = "Grow With Role";
else if(sum <= 17)
event.value = "Grow With Role";
else if((sum <= 22) && (sum >=17))
event.value = "Promotable";
else if(sum >= 23)
event.value = "High Potential";}
else
event.value = "";