Hi,
I've have an requirement like counting the number of times a form is opened and number of times a button is clicked.For this I tried to use global variables.I tried to increment the value of the variable each time a form is opened or a button is clicked.
opencount.value += 1;
But it didnt work for me.I tried to hardcode a value like
opencount.value = 5;
Even this is also not working.Do I need change any settings or extend rights.Is it possible to save the values that are persistent across the sessions.
Please help
Views
Replies
Total Likes
Hi,
Have a look at using the <desc> element here: http://assure.ly/x1QObn. It is preserved across sessions.
Niall
Hi,
Thanks for the reply.I dont think the state is maintained here.Once the form is closed and reopened the <desc> element got reset to original state (null).
I want the state of an object to be maintained.I cant expect the user to save a form.
Views
Replies
Total Likes
Hi, can't test now - will have a look tomorrow. Niall
Views
Replies
Total Likes
Hi,
I have checked the above example above and it does preserve the variable attached to the <desc> element. In your form, make sure that in the File > Form Properties > Defaults tab that the Preserve Script Changes is set to Automatic.
Hope that helps,
Niall
Views
Replies
Total Likes
I have another apporach using an extras object.
What you is a script object 'Actions' with this script, to create a counter in the extras object in any form object.
Then you need another script, to call the function in the script object and raise the counter, when the form opens.
I used a floating field in a text on a master pager and put this script into its initialize event.
Here's a sample form with an open and save counter.