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 == event.target.charLimit) {
// since key stroke is good and character limit reached - go to next field
item.getField(cName).setFocus();
} // end if key stroke filter passed and character limit reached;
return;
} // 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.