These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Button font color in dynamic xml

erikf1000
Registered: May 27 2010
Posts: 3
Answered

The short version: is it possible for scripts to change the font color of regular buttons in a dynamic xml form?

The scenario: I've been working with a static PDF for some time now. It uses several buttons that change font color based on other values, to indicate their purpose to the user. (Note that everything works great with the static PDF, and that *just* changing fill or border color doesn't really fill the need in this case.) Unrelatedly, I wanted to add a feature that let users choose one of several images to display in a particular spot. After some research, I found that this is only possible after saving the file as an Adobe dynamic xml form, as it requires re-rendering. Fair enough. Trouble is, as soon as I swap over to a dynamic xml form, all the buttons no longer obey their font color changing scripts. Fill color seems to work, I get no errors, and the underlying values are indeed updating. The results just aren't visible.

(I'm using LiveCycle version 8.2, if it matters.)

Any thoughts would be greatly appreciated!

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Maybe the problem is the event you placed your script.

If you like to check a value of another form field for example, the best way is to put the script into the layout:ready event of the button.

if(Field1.rawValue == "n/a") thenthis.caption.font.fill.color.value = "255,255,255"elseif(Field1.rawValue == "Yes") thenthis.caption.font.fill.color.value = "55,5,99"elseif(Field1.rawValue == "No") thenthis.caption.font.fill.color.value = "5,95,127"elsethis.caption.font.fill.color.value = "0,0,0"endif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

erikf1000
Registered: May 27 2010
Posts: 3
Thanks for the response!

While it could be the particular event, I tried various, to make sure. Specifically, I tried using one button's click event to set other buttons' font color. That way, I could be sure I had the script in the right place.

That said, your response held the answer: I'd been setting "this.fontColor" instead of "this.caption.font.fill.color". Setting the latter seems to get everything up and running again.

Thanks again!