Skip to main content
Participating Frequently
June 28, 2024
Answered

Dropdown to populate checkbox with either of two different values checking same box

  • June 28, 2024
  • 1 reply
  • 556 views

Thanks in advance for your help!

 

I have a dropdown with three options:

Yes.

No because A.

No because B.

 

Later in the form, I want either a "yes" checkbox automatically checked or the "no" checkbox.

I can get the "yes" to work fine, but can't get the script to use both "no" responses--it just takes one. I'm sure I'm missing something little, but don't know what. Any suggestions? Thanks!

 

this.getField("LEP Special Factor Response Confirm No").checkThisBox(0,event.value == "No. The child's home language is English." ? true : false);
this.getField("LEP Special Factor Response Confirm No").checkThisBox(0,event.value == "No. The child's home language is not English, but they demonstrates appropriate English proficiency." ? true : false);
this.getField("LEP Special Factor Response Confirm Yes").checkThisBox(0,event.value == "Yes. The child demonstrates limited English proficiency." ? true : false);

 

This topic has been closed for replies.
Correct answer PDF Automation Station

Thanks so much! I knew that was happening, but had no idea how to fix it. Appreciate the help!


Assuming your check boxes are mutually exclusive, an easier way to write this script is to name the two checkboxes identically, with one export value as "Yes" and the other as "No".  Then add Yes and No export values to the dropdown statements.  Add the following custom keystroke script to the dropdown (assuming checkbox name is "Checkbox 1"):

 

if(!event.willCommit)

{this.getField("Checkbox 1").value=event.changeEx;}

1 reply

PDF Automation Station
Community Expert
Community Expert
June 28, 2024

Where is your script located?

Participating Frequently
June 28, 2024

Within the dropdown properties under Validate.