Expand my Community achievements bar.

How do I do to set a javascript variable as Global?

Avatar

Level 4

Hi

How do I do to set a javascript variable as Global?

I want that this variable it works in all the pages of my form.

3 Replies

Avatar

Level 10

You can goto File -> Form Properties and then select the Variable tab to define the variables which can be accessed in all the pages of the form.

Thanks

Srini

Avatar

Level 4

I just had a quick question to add to this answer,

Is it me but it looks like these are only session based variables. What i mean  by that is that as soon as i close the form and re-open it the value passed to that variable via javascript in not stored any longer.

What ever value you store via java in those, are re-initialize, is that correct?

If it is, is there anyway at all to use a variable in such a way as it will retain whatever info you stored into it at anytime during the use of the form and keep that value once re-opened?

Thank you,

PAtrick

Avatar

Level 10

I think since Acrobat 9 the variables are saved but I read somewhere that the variables have to have a value when created (don't just create blank form variables). And it may also be better to create them on the fly according to this post:

http://blogs.adobe.com/formfeed/2008/10/form_variables.html