Previous | Next | (P-PDF) JavaScript
Topic: Adobe 5.05 Script vs newer versions -- HELPP!, 1 Attachments
Conf: (P-PDF) JavaScript, Msg: 157207
From: ghloid
Date: 12/30/2006 07:37 AM
Hello all,
I'm desperately seeking some help with a type of validation I'm
using on my PDF forms. I'm using Acrobat 5.0 to put on all the fields and javascripting. There must be something in A 5.0 in terms of the javascript evaluation, because my form works fine in that version, but not the newer 7.08 version (or probably higher).
I have attached a copy of the file to this posting.
The basics behind a user using this form are that the user loads the form up in Adobe (Reader or Acrobat should be fine), and they go to a page where they can type information. When the user clicks a button marked "Start Working" the form is enabled for typing (set the fields off of 'read only' status). That triggers a check box to be marked off 'Yes' (the chkPg field on every typeable page),
and the Start Working button disappears to reveal the Stop Working button. Also, a field is displayed that shows the PDF is ready for validation and typing. These events will trigger whether or not validation happens when a user clicks away from the page (forward or back). When the user does try to leave the current page, and things aren't typed in that should be typed in, the validation begins.
There are 3 basic document level scripts that validation works on.
1. The ChkCurrentPg script fires at the opening of any new page. That will determine if the page should be validated, or it shouldn't be because the user hasn't finished filling in data from a previous page. That function is really dependant upon the "chkStopChk" field. If this field is 'Off' then the page is marked for validation. If not, the user must have forgotten something on a previous page, and the page is NOT marked for validation.
2. The ChkPgValidation script is fired during a page close action and it returns whether or not to do validation as well. If this returns true (or 'CheckIt' from the function), then the page validation begins.
3. The StopChk function works when a page has not passed validation and the "chkStopChk" field needs to then be marked "Yes". This will stop further page validation, and allow for the user to return to the previous page to fill in the required info (via a setFocus command).
When the user has successfully completed a page, the validatedpg function fires to mark the page as validated (changed the text in the display field on the page, and sets off the "chkStopChk" button).
A user can also stop page validation at any time by click the "Stop Working" button to print the form, or just stop working for the day.
One final function that is built in is the FormFldVal function which works on a custom keystroke event of every text field. That's in place if a user returns to a page that was previously validated, and they want to change information (delete the text there or something).
At any rate, this works PERFECTLY in Adobe 5.05. When I try it in AR 7.08, it doesn't look like things are firing in order correctly. If you try working on a page, and you leave something blank to go to another page, the validation kicks in slowly and for whatever reason, the following page is marked for validation (which shouldn't happen), and you get caught in a terrible setFocus loop for both pages.
I worked very hard to prevent that in Adobe 5.05, but my checks and balances don't seem to work for the newer versions.
Any help on this is GREATLY appreciated.
Thank you!!!!
321AppPacket.pdf
Ghloid's Page Validation Example (411,775 bytes)