Expand my Community achievements bar.

Transparent Fill for Dropdown Box

Avatar

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

Avatar

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

}

Avatar

Level 8

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

Kyle

Avatar

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.