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

Checkbox show/hides based on dropdown selection

New Here ,
Feb 18, 2021 Feb 18, 2021

Copy link to clipboard

Copied

My form includes a checkbox I would like to show/hide depending on the selection made in a dropdown list. The custom calculation script (below) I've used works for text and text fields, but I just can't work out how to simply hide/show the checkbox. Any help would be great.

 

if (this.getField("electivetype").value == "EEG - SPECT (ictal)"){ //replace "dropdown" with the name of the dropfield
event.target.display = display.visible;
}
else{
event.target.display = display.hidden;
}

TOPICS
How to , JavaScript , PDF forms

Views

589

Translate

Translate

Report

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 18, 2021 Feb 18, 2021

Copy link to clipboard

Copied

LATEST

In a dropdown field as 'Custom calculation script' you can use code like this:

this.getField("Checkbox name goes here").display = event.value == "value goes here" ? display.visible : display.hidden;

Votes

Translate

Translate

Report

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