By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,563 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,563 IT Pros & Developers. It's quick & easy.

Can a global variable save a changed value permanently, even after form is closed?

P: 1
Hi,

I was working with acrojavascript when i came acroos it.

I have a pdf form. A global variable t=1 is initialized. Just before the form is closed, it calls a function dat increments its value by 1 and makes t=2 before closing. Now the application is closed.
Whenever i open it again, it gets reinitialized to t=1.

But i want the value of this variable to store t=2 permanently, even after the form is closed. the code i used is:

//a global is declared in form's property as y=1

var t=y.value;

function increment()
{
t++;
app.alert("value incrementd: "+t);
} // it shows t=2. (fine till here)

function save()
{
y.value=t;
app.alert("in function save: "+ y.value+" & t is: "+t);
} //it shows y=2 and t=2. (fine till here)

But then, i cudnt figure out how to make this change be stored permanently. So dat, next time when form is opened again, it shud have y=2.
Apr 12 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Welcome to TSDN.

I am unfamiliar with Acrojavascript, but javascript, in any case, is not persistent. You can't have session variables like you can with server-side languages.

What you can have are cookies. However, I am not sure what, if any, equivalent there is for acrojs.
Apr 13 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.