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

global variable not saved?

smilem
Registered: Apr 1 2008
Posts: 101

Hi, I use button to change global variable from 0 to 1 and change textfield text from normal to bold.

if (boldValue.value == 0)
{
boldValue.value = "1";
Button9.fillColor = "222,229,255"
TextField1_1.font.weight = "bold"
}
else
{
boldValue.value = "0";
Button9.fillColor = "212,208,200"
TextField1_1.font.weight = "normal"
}

I save the document in adobe reader with user rights enabled
When I open the document I check the global variable at initialization:

if (boldValue.value == 0)
{
Button9.fillColor = "212,208,200"
TextField1_1.font.weight = "normal"
}
else
{
Button9.fillColor = "222,229,255"
TextField1_1.font.weight = "bold"
}

But it seems the global variable changes only on runtime and is static. How do I solve this?

My Product Information:
LiveCycle Designer, Windows
smilem
Registered: Apr 1 2008
Posts: 101
Should I use hidden textfield?
smilem
Registered: Apr 1 2008
Posts: 101
I have used hidden textfields as I said above, but I think there should be better way. Anyone who knows how to do the the proper way, please respond.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Are you using the Acrobat JavaSript 'global' object and 'subscribed' method?

I do not see any global variable being defined.

This may only work in Acrobat created forms and not in LiveCycle Designer created forms.

George Kaiser