Copy link to clipboard
Copied
I have 2 groups of radio buttons
Group 1 is named "FTO" and has options "FIRSTTIME" and "REORDER"
Group 2 is named "DST" and has options "YES" and "NO"
What Javascript do I use to get the value of the radio buttons and use them in a calculated field?
My end goal is to say "if REORDER is checked, then event.value=0 else if DST is set to "YES", then event.value=100 else event.value=75.
I'm a total newbie at Javascript, so any help is appreciated. This is what I tried last:
var radioFTO = this.getField("FTO").value
var radioDST = this.getfield("DST").value
if (radioFTO.value="REORDER") {event.value=0}
else if (radioDST.value="YES") {event.value=100}
else {event.value=75}
Copy link to clipboard
Copied
Hi,
I think you are just using the value() call to often, and you also need to use two equals signs for "is equal to" something like
var radioFTO = this.getField("FTO").value
var radioDST = this.getfield("DST").value
if (radioFTO=="REORDER") {event.value=0}
else if (radioDST=="YES") {event.value=100}
else {event.value=75}
Copy link to clipboard
Copied
Small correction. The second line should be:
var radioDST = this.getField("DST").value;
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more