Skip to main content
November 7, 2025
Answered

if dropdown says specific text, then checkbox is marked

I'm trying to make it where if a dropdown of US states triggers a check box. I want 49 states to trigger this and only one (KY), to not trigger the text box. Is this possible?

 

Dropdown list name: TitleState

Check box name: OOS

Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
November 7, 2025

In the other thread a regular expression was used to test for a an empty field value.  You're current request isn't really all that different. It's just the test that needs to be adjusted.   So you want the text "KY" to uncheck, and all other values to check. 

Here's the code to put in the custom "Validate" script on the dropdown:

 

**Edited to correct coding

this.getField("OOS").checkThisBox(0, event.value != "KY");

  

 

 

 


Just a small mix-up! The 0 goes first in the function. So it should be:
this.getField("OOS").checkThisBox(0, event.value != "KY");

5 replies

Meenakshi_Negi
Legend
November 7, 2025

Hi symone_1736,

 

Thank you for reaching out.

 

Please try the suggestion provided and correct the marked in the following community thread with a similar question: https://adobe.ly/4hR2xt5. 

Hope that helps.

 

Thanks,

Meenakshi

 

Translate
November 7, 2025

That community post was also me. The difference here is that I need specific text to trigger the checkbox. I need 49 states to trigger the check box to be checked; I need 1 state to ensure that this checkbox remains unchecked.

Translate
Thom Parker
Community Expert
Community Expert
November 7, 2025

In the other thread a regular expression was used to test for a an empty field value.  You're current request isn't really all that different. It's just the test that needs to be adjusted.   So you want the text "KY" to uncheck, and all other values to check. 

Here's the code to put in the custom "Validate" script on the dropdown:

 

**Edited to correct coding

this.getField("OOS").checkThisBox(0, event.value != "KY");

  

 

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often