Skip to main content
robert.a.marsh
Known Participant
March 2, 2017
Question

How can I keep the auto tab function from jumping back and forth from current to first page. The pages are alike and spawned.

  • March 2, 2017
  • 3 replies
  • 506 views

Here is my current coding;

Custom Format:

var cPreFix = "";

// get prefix elements for spawned pages;

var aFieldName = event.target.name.split(".");

if(aFieldName.length > 2)

{

// first 2 elements of name array makeup the prefix for fields on a spawned page;

cPreFix = aFieldName[0] + "." + aFieldName[1] + ".";

}

Key Stroke:

goNextAlpha(this, event, cPreFix + "ls.1", true);

This only occurs when not completely filling in the auto tabs of previous pages, is there additional coding or changes that need to be made. Thanks.

This topic has been closed for replies.

3 replies

robert.a.marsh
Known Participant
March 10, 2017

My employer will not allow the uploading of the file. The script above is what has been inputted, based on what you see, what can I do, or what additional script is needed.

Basically, I have 12 single entry fields that once the field is filled it goes to the next field. If I spawn additional pages it works fine as long as you complete forms in order. There are times the Forms need to be completed in different order and when doing so when you fill field 1 of page three it then goes to field 2 page 1 and then back to field 3 page 3.

I appreciate all your help.

Inspiring
March 10, 2017

Your code for the custom keystroke has finished executing before your validation code, so you are using the "P#.TemplateName." prefix  value form a previous form field.

You should be computing the "P#.Temppate." prefix value in the same action where you are calling and  before calling the "GoNextAlpha" function. Please review the linked page that shows the execution order of the various actions for the field object.

robert.a.marsh
Known Participant
March 4, 2017

I'm using the "goNextAlpha" function in the keystroke portion of the script.

Showing no Javascript Console errors

I will try and export the page for posting.

Inspiring
March 6, 2017

See Form event processing flowchart. Each step is completed before the next step is processed. So your custom keystroke script is completely processed before the validation script is processed. If you want the prefix for the focused field, you need to execute your script before the custom format script or within the custom format script before calling the goNext function.

Inspiring
March 3, 2017

Did you include the document level function "goNext"?

This is pretty hard to diagnose without seeing the form . Can you post a link to a sample form with the issue?

Also check the JavaScript console for any errors.

Have you looked at the Acrobat JavaScript Reference for information about the order of the actions for a field. Keystroke scripts are run as data is entered and before the value of the field is completed or committed. The format script only executes after all keystroke, validation, and calculation scripts have run. You computation of the prefix portion of the field name has not been updated for the currently focused field.