Skip to main content
Known Participant
February 6, 2021
Answered

switching dropdown background colour on and off?

  • February 6, 2021
  • 1 reply
  • 650 views

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;

}

 

 

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

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;

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
February 6, 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;

Mark5EC1Author
Known Participant
February 6, 2021

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