Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Transparent Fill for Dropdown Box

ASimpleQuestion
Level 1
Level 1

I've made a javascript to change the fill color of a drop down box depending on what is selected. Everything is working as expected except that I can't find how to fill it with a transparent/no fill color. I've found very discouraging info about being able to do this online, but the box starts as transparent (imported the document from a preexising pdf that has the box background at no fill) so I'm hoping that it is still possible. Using CS3, any help is greatly appreciated.

3 Replies
ASimpleQuestion
Level 1
Level 1

Code example below. The "1" value is what the box starts at with a transparant/no fill and what I want to change back to that transparent/no fill when selected.

var vName = this.somExpression;

var fieldObj = xfa.resolveNode(vName + ".ui.#choiceList.border.fill.color");

if (this.rawValue == "1") {

     fieldObj.value = "255,255,255";

}

else if (this.rawValue == "2") {

     fieldObj.value = "255,255,255";

}

else if (this.rawValue == "3") {

     fieldObj.value = "250,250,0";

}

else if (this.rawValue == "4") {

     fieldObj.value = "0,145,0";

}

else if (this.rawValue == "5") {

     fieldObj.value = "205,0,0";

}

else if (this.rawValue == "6") {

     fieldObj.value = "90,90,90";

}

else if (this.rawValue == "7") {

     fieldObj.value = "25,25,25";

}

else {fieldObj.value = "0,0,0";

}

dcidev
Level 8
Level 8

this.border.fill.presence="hidden";

Kyle

ASimpleQuestion
Level 1
Level 1

Thanks for the help but the hidden state doesn't seem to work. I've circumvented the problem atm by placing a blank text field behind the drop down box and just have the box control the fields color, turning it invisible for when I want the transparency.