Skip to main content
Known Participant
March 11, 2024
Answered

hidden check box with dropdown

  • March 11, 2024
  • 1 reply
  • 977 views

Hello,
Hello,
on my pdf form,
I have this part in image.
I would like that when I select for example samsung in the Dropdown, the checkbox OK, No is invisible (or deactivated, but N/A remains active and visible and when I take Iphone, N/A is invisible (or deactivated) but Ok and No remains active and visible.

 

Name Dropdodwn : Produit

Name Checkbox : Check

     Export Value : Ok (Yes), No (Yes1), N/A (Yes2)

 

this code works, but hides or displays everything. i can go further.

 

 

this.getField("Check").display = event.value == "Samsung" ? display.visible : display.hidden;

 

 Thanks for your help

This topic has been closed for replies.
Correct answer Nesa Nurani

Since checkboxes are mutually exclusive, you need to access their individual widgets, like this:

this.getField("Check.0").display = (event.value == "Samsung") ? 0 : 1;
this.getField("Check.1").display = (event.value == "Samsung") ? 0 : 1;
this.getField("Check.2").display = (event.value == "Iphone") ? 0 : 1;

 

If you have more conditions, use if/else instead of ternary operator.

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
March 11, 2024

Since checkboxes are mutually exclusive, you need to access their individual widgets, like this:

this.getField("Check.0").display = (event.value == "Samsung") ? 0 : 1;
this.getField("Check.1").display = (event.value == "Samsung") ? 0 : 1;
this.getField("Check.2").display = (event.value == "Iphone") ? 0 : 1;

 

If you have more conditions, use if/else instead of ternary operator.

Known Participant
March 11, 2024

Thanks @Nesa Nurani  it works