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

39

Likes

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
Adobe Community Professional ,
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;

Likes

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