switching dropdown background colour on and off?

Community Beginner ,
Feb 06, 2021 Feb 06, 2021

Copy link to clipboard

Copied

Hello. My form (created using Acrobat Pro) contains a number of dropdown boxes, with their background colour changing based upon dropdomn selection.  It would be really useful if there was an option to switch off (and back on) all the dropdown box background colours.  The reason being, the form is part of an assessment – for some users, it’s helpful to have the dropdown boxes colour showing, but for other users the coloured background could cause an issue.  Would this be possible?  The following is the current java script for one of my dropdown boxes.  Many thanks, Mark

 

var f = event.target;   

var fv = event.value;

 

if (fv == "Excellent range of skills evident") {

    f.fillColor = ["RGB", 0, 0.5, 0.9];

}

else if (fv == "Skills consistently demonstrated") {

    f.fillColor = ["RGB", 0.1, 0.8, 0];

}

else if (fv == "Skills occasionally demonstrated") {

    f.fillColor = ["RGB", 1.02, 0.66, 0];

}

else if (fv == "Skills never / rarely demonstrated") {

    f.fillColor = ["RGB", 1.02, 0.276, 0];

}

else {

    f.fillColor = color.transparent;

}

 

 

TOPICS
Create PDFs, How to, PDF forms

Views

135

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

correct answers 1 Correct Answer

Adobe Community Professional , Feb 06, 2021 Feb 06, 2021
You can make checkbox and add this code to the bottom of your code, it will make field transparent if checkbox is checked.if(this.getField("Check Box1").isBoxChecked(0)) f.fillColor = color.transparent;

Likes

Translate

Translate
Adobe Community Professional ,
Feb 06, 2021 Feb 06, 2021

Copy link to clipboard

Copied

You can make checkbox and add this code to the bottom of your code, it will make field transparent if checkbox is checked.

if(this.getField("Check Box1").isBoxChecked(0))
f.fillColor = color.transparent;

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
Community Beginner ,
Feb 06, 2021 Feb 06, 2021

Copy link to clipboard

Copied

LATEST

Perfect, thanks Nasa. 

Is there any way that, when the checkbox is selected, the dropdown boxes update - essentially toggling between the colours being on and off?  

Thanks, Mark  

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