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

need help finishing this string

jsmith
Registered: Apr 18 2008
Posts: 9

Hello All,
I am currently getting part of the result I want from the following text field script:

this.getField("Text1").value=25715+1

It is applied to the action field with "on focus" as the trigger.

My problem is that I need the number to continually increment by one and with this script it only increment s once, so once it hits 25716 the action does nothing.

Can anyone help finish this string so that the number will continue to increment by one. Ideally I would like it to do it every time the document is accessed.

Other items of note:
This document will be used as an e-form for our document management system so there is no need to for global settings to be carried over to other network users etc. (I think?)
If I could just finish the script to get the desired result on this form I would be happy at this point.

Thanks for all input in advance.

My Product Information:
Acrobat Pro 8.1.2, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You are getting the correct results for the script.

To increment a field by "1" you need to manipulate the field value by one:

event.value++; // increment current field value by 1
event.value = 1 + event.value; // add 1 to current field value

To increment a field's value by 1 each time the PDF is opened will require storing the value for the field as updated either within the PDF or in an independent storage area. One will also have to provide some method to resolve simultaneous access to the PDF by more than one user.

George Kaiser

jsmith
Registered: Apr 18 2008
Posts: 9
Could you explain how I could store the value in the PDF?