For the post about this I have responded to I provided a link to the fully functional form.
JavaScript - setFocus Method for tabbing to next form field
The example if for a Social Security Number in 3 parts so there is included some keystroke validation for only numeric data.
The document level script is:
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;