I have a drop down list that changes color depending on selection. See script below.
form1.Page1.Status.DDlist1::change - (JavaScript, client)
switch(xfa.event.change)
{
case "Green":
this.ui.choiceList.border.fill.color.value = "0,128,0";
break;
case "Yellow":
this.ui.choiceList.border.fill.color.value = "255,255,0";
break;
case "Red":
this.ui.choiceList.border.fill.color.value = "255,0,0";
break;
case " ":
this.ui.choiceList.border.fill.color.value = "255,255,255";
break;
}
This works fine if the user does not save the form. When the form is saved, the color does not hold.
I have Adobe Designer ES, however, I have Acrobat 7.0 so I don’t have the luxury of selecting the Automatic option in the Preserve scripting changes to form when saved - it is not supported.
Can someone provide a script to hold the color selection.
Thanks!
Views
Replies
Total Likes
I tried your code with Acrobat 9 and it saves the color and the value...
However if it does not work I would look in to alternative methods to force it to run the same script with minor changes at the time of docReady/formReady to make it look like it saved the color....
switch
(this.rawValue)
{
case
"Green":
this.ui.choiceList.border.fill.color.value
= "0,128,0";
break
;
case
"Yellow":
this.ui.choiceList.border.fill.color.value
= "255,255,0";
break
;
case
"Red":
this.ui.choiceList.border.fill.color.value
= "255,0,0";
break
;
case
" ":
this.ui.choiceList.border.fill.color.value
= "255,255,255";
break
;
}
Good luck,
Views
Replies
Total Likes
Hi Michelle,
Just for your reference check the following :
Click on File -> Form Properties -> Defaults -> Under Preserve scripting changes to form when saved : Click" Manually".
Thanks,
Bibhu.
Views
Replies
Total Likes
Thanks but this doesn't work for me. The version of Acrobat I'm using does not support this.
Views
Replies
Total Likes
I figured it out, I added script to the formReady event.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies