Copy link to clipboard
Copied
Hi,
I have a few issues regarding a multiple condition statement. I am trying to add If && to the below code additions in bold
if (this.getField("Radio Button 1").value == "1") && if (this.getField("Bespoke Button").value == "Yes")
event.value ="Matthew" ;
else
if (this.getField("Radio Button 1").value == "2") && if (this.getField("Dropdown4").value == "Yes")
event.value ="Andy Stammers";
else...
Few similar lines so won't post all code.
I cannot get the multiple conditions to work. Can somebody help?
Thanks,
George
Copy link to clipboard
Copied
Basically, you need to change this line:
if (this.getField("Radio Button 1").value == "1") && if (this.getField("Bespoke Button").value == "Yes")
To this:
if (this.getField("Radio Button 1").valueAsString == "1" && this.getField("Bespoke Button").valueAsString == "Yes")
And repeat for the rest of your if-conditions.
Copy link to clipboard
Copied
You have errors in your code. Check the JS Console and they should appear there as soon as you enter it.
Copy link to clipboard
Copied
Basically, you need to change this line:
if (this.getField("Radio Button 1").value == "1") && if (this.getField("Bespoke Button").value == "Yes")
To this:
if (this.getField("Radio Button 1").valueAsString == "1" && this.getField("Bespoke Button").valueAsString == "Yes")
And repeat for the rest of your if-conditions.
Copy link to clipboard
Copied
Sorry try67, I'm a complete novice. the editor isn't very explanatory as to where the errors are within the code.
Thanks for your help. Worked Great.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more