auto tab to next field

I would like certain text fields such as year (2012), phone numbers, zip codes, etc., to automatically fill in the entered user data, and the cursor automatically jump to the next field without having to use the tab button to go to the next field. Combing does not seem to work, even with "check spelling" & "scroll long text" deselected. Combing simply evenly spreads the pertinent digits into the field, but the tab button itself must still be utilized to move to the next field.

Richard Auensen

4 Answers

Voted Best Answer

You need to have some knowledge of Acrobat JavaScript and how it works.

The document level JavaScript is used to save rewriting the code into every field. This improves editing and correcting the code and the execution of the code. The document level function code called the the custom keystroke of the form field:

function goNext(item,event,cName){
// keystroke filter for numeric data only - change for other character filters;
AFNumber_Keystroke(0,0,0,0, "",true);
// see if key stroke filter passed and field has reached the character limit of the field;
if(event.rc && AFMergeChange(event).length == {
// since key stroke is good and character limit reached - go to next field
} // end if key stroke filter passed and character limit reached;
} // end goNext function

For the field you need to set the maximum character limit through the field's property.

For a series of Fields named "SSN.0", "SSN.1", and "SSN.2" that holds the SSN in groups of 3, 2, and 4 characters.

For the "SSN.0" field, the maximum character length is set to 3.

You use the following custom keystroke JavaScript in the custom keystroke JavaScript:

goNext(this, event, "SSN.1");

"goNext()" is the call to the document level function that perfoms the auto tab action.

The positional parameters used by the 'goNext' function are:

"this" is the current open PDF

"event" is the event currently being processed

"SSN.1" is the field to auto tab to when the field is full.

By George Kaiser   

The example I have seen requires the maximum number of characters to be set to a finite number and then a custom JavaScript keystroke is used to detect when that number of characters has been entered into the field and then focus is set to the next field.


Entering Document Scripts by Thom Parker

George Kaiser   

And is there a sample somewhere of the pertient Javascript, which can be copied, pasted, and edited accordingly.

Richard Auensen   

Please specify a reason: