Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Select RadioButton based on dropdown values

New Here ,
Feb 28, 2017 Feb 28, 2017

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 ?

TOPICS
Acrobat SDK and JavaScript
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 28, 2017 Feb 28, 2017

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".

Translate
Community Expert ,
Feb 28, 2017 Feb 28, 2017

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".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2017 Feb 28, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2017 Feb 28, 2017
LATEST

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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines