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

Auto Tab

shawnash
Registered: Dec 16 2009
Posts: 48
Answered

Hello,
 
I have a form with numeric data that I need to have auto tab. I have set the maximum characters for the fields, but how do I get them to auto tab to the next field?

My Product Information:
Acrobat Standard 5.x or older, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Accepted Answer
You need to use a custom key stroke to test for numeric entry and length of the data entered.

A document level function for numeric input:

function goNext(oItem, oEvent, cName) {
/* Tab to next field when field character limit is reached.
Includes alpha fields and case change.
Includes error trapping and displays on JavaScript console
the error, field where error occurred and next field name.

parameters:
oItem - required - item where fields to process reside
oEvent - required - field being processed
cName - required - next field's name

Place call to this function in the fields custom format.
The user responsible for checking format of field.
Default number check is for the standard numeric values.
"0-9" for single character fields and includes sign values for multi character fields.

Call for numeric field:
goNext(this, event,"NextField");
*/
try{ // error catcher
AFNumber_Keystroke(0, 0, 0, 0, "",true);
if (oEvent.rc && AFMergeChange(oEvent).length == oEvent.target.charLimit) oItem.getField(cName).setFocus();
} catch(eMsg) { // trap error display error message, field in and next field
app.beep(3); // beep
} finally { // always run
return; }

} //end goNext

The custom keystroke code:

goNext(this, event, "NextFieldName");


George Kaiser

shawnash
Registered: Dec 16 2009
Posts: 48
Thank you very much for your help - that worked! :)