Copy link to clipboard
Copied
3 Radio button but same group
choice1
choice2
choice3
Field name: Box6
Box6 = 150 when choice1 is selected
Box6 = 220 when choice2 is selected
Box6 = 270 when choice3 is selected
I need the script for box6 please
Let's say that the name of the radio button field is "Radio1"
Put this in the Custom Calculation script for the text field.
var cRadioValue = this.getField("Radio1").value;
switch(cRadioValue)
{
case "choice1":
event.value = 150;
break;
case "choice2"
event.value = 220;
break;
case "choice3":
event.value = 270;
break;
default":
event.value = 0;
break;
}
You can also change radio buttons choices to values you need. For example: instead of choice1 add 150, instead of choice2 add 220...etc. Then as calculation script of box6 field use this:
event.value = "";
if(this.getField("Group1").value != "Off")
event.value = this.getField("Group1").value;
Copy link to clipboard
Copied
Let's say that the name of the radio button field is "Radio1"
Put this in the Custom Calculation script for the text field.
var cRadioValue = this.getField("Radio1").value;
switch(cRadioValue)
{
case "choice1":
event.value = 150;
break;
case "choice2"
event.value = 220;
break;
case "choice3":
event.value = 270;
break;
default":
event.value = 0;
break;
}
Copy link to clipboard
Copied
I tried this script but its not working!!!
Copy link to clipboard
Copied
Did you change the radio button field name "Radio1" to the real name of your radio button group?
Do the export values match the values used in the script?
Copy link to clipboard
Copied
You can also change radio buttons choices to values you need. For example: instead of choice1 add 150, instead of choice2 add 220...etc. Then as calculation script of box6 field use this:
event.value = "";
if(this.getField("Group1").value != "Off")
event.value = this.getField("Group1").value;
Copy link to clipboard
Copied
It works thanks!!!