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

How to clear checkbox when specific option is selected in dropdown field

New Here ,
Mar 28, 2023 Mar 28, 2023

Hello, I have a dropdown field that contains 3 options.  I also have 5 checkboxes.  When one of the options is selected (specifically D3) I need to have all checkboxes unchecked/cleared, made read only and greyed out.  I would also be awesome if I can add a message to the user when they try to check one indicating that the box is not available with the option chosen above (the message is not something that I have to have, but would be nice).

 

If either of the other two options are selected, the checkboxes should be open for users to check, not greyed out, and would not return a message.

 

I have not been able to find anything that is working.  I have never done this before and admit that I have no idea what I am doing.  Below is what I have tried:

 

var g = event.value;
var f = this.getField("Option1");

if (g =="D3)") {

f.checkThisBox(2, false);
this.getField(f.name+".2").fillColor = ["G",0.7];
f.readonly = true;

} else {

f.readonly = false;

f.fillColor = ["RGB",0.874,0.874,1];

}

TOPICS
How to , JavaScript , PDF forms
244
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
no replies

Have something to add?

Join the conversation