Copy link to clipboard
Copied
Hey Everyone,
I'm trying to populate a radiobutton selection based on the values of two drop down values in Adobe Acrobat X. Here's my javascript, but it doesn't populate the radiobutton/check it. I've put the javascript as a validate event in the second dropdown, although it doesn't work under calculate either.
if(this.getField("ddlOne").value == "Admin" && event.value == "User")
{
this.getField("Checkbox").value = "On";
}
Any ideas ?
First of all, the comparison operator in JS is "==", not "=". So you need to change both of them in your if-statement.
Also, you need to make sure what is actually the "on" value of your check-box. By default it is "Yes".
Copy link to clipboard
Copied
First of all, the comparison operator in JS is "==", not "=". So you need to change both of them in your if-statement.
Also, you need to make sure what is actually the "on" value of your check-box. By default it is "Yes".
Copy link to clipboard
Copied
Thnx try67,
I actually had it as "==" because the acrobat js editor won't allow "=" but I accidentally put "=" in my post. Although I think the issue was ON needed to be Yes as you pointed out.
Would it be possible to initiate this on dropdown selection ? Currently it seems like I have to click out of the drop down in order to get the radio button selected.
Copy link to clipboard
Copied
Yes, it's possible. Place the code as the drop-down's custom validation script and make sure to tick the option to commit the selected value immediately (under the field's Properties - Options tab).
Find more inspiration, events, and resources on the new Adobe Community
Explore Now