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

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

405

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

Community Expert , 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;

Votes

Translate

Translate
Community Expert ,
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;

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
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  

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