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

Adobe Form Javascript - Required Field Validation per page

Nimae
Registered: Feb 10 2009
Posts: 2

Hi all,

I'm new to Adobe forms and also Javascript. I have been putting together field specific validation but need to expand this a bit and force users to update a series of fields within a given page based on valudes placed in another page. Please note that the user must save the form and email/publish.

This is what i'm trying to achieve in a 4 page form.

in Page 1
if field a=yes
then
set focus on page 4
require users to fill out page 4 (field x,y,z)
then they are free to update any other elements in the form.

I thought maybe on the File-save I could enforce this...

any help is greatly appreciated.

My Product Information:
Acrobat Pro 9.0, Windows
maxwyss
Registered: Jul 25 2006
Posts: 255
What type is field a? Checkbox?

The term "set focus" has a specific meaning, namely to activate a specific field. So, you could set focus on the first field to be filled on that page 4. You also can do it very simply and go to page 4 by setting the pageNum to 3 (note Acrobat starts page numbering with 0).

Assumed field a is a checkbox, you would put the following code into the MouseUp action:

if (event.target.value == "Yes") {
this.pageNum = 3 ;
}

and that would get you to page 4

or you would use

if (event.target.value == "Yes") {
this.getFielc("mytargetfield").setFocus() ;
}

and that would get you to the field named "mytargetfield"

Hope this can help.