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

Auto Tab help needed, please

Timmyb
Registered: Nov 19 2007
Posts: 25

Hi

I am using Acrobat Pro 8 and have the following code to capitalise my entries

"event.change=event.change.toUpperCase();"

What do I need to add to get the curser to tab to the next field when the current field is complete?

Please assume basic Java Knowledge. If someone could tell me what to type and where that would be great!

Thanks
Tim

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
See "Autotab and force uppercase"

http://forum.planetpdf.com/wb/default.asp?action=9&read=43785&fid=34#118131

George Kaiser

Timmyb
Registered: Nov 19 2007
Posts: 25
Thanks for this.

Dumb question.... what goes in the document level script and what goes in the text box? Becuase i can't seem to get it to work.

I am using comb fields.

Will this autotab for alpha / numeric?

Thanks
Tim
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
This script is for alpha strings and not numbers, there is a different version for numberic values becuause of the keystroke checking.

Here is code for a both numeric and alpha, if your comb field is mixed numeric and alpha, you will need to write custom code for keystroke, validation and formatting using the RegExp object.

// --- start code --- document level script

function AutoTab(doc, event, cNext)
{
// Call the built-in routine to allow numbers only.
AFNumber_Keystroke(0, 0, 0, 0, "", true);
// If we've filled in the field completely, jump to the next one.
if (event.rc && AFMergeChange(event).length == event.target.charLimit)
doc.getField(cNext).setFocus();
}

function goNextAlpha(doc, event, cNext, bCaps) {
if (bCaps) event.change = event.change.toUpperCase();
if (AFMergeChange(event).length == event.target.charLimit) {
item.getField(cNext).setFocus();
}
}

goNext(doc, event. cName, bAlpha, bCaps){
if(bAlpha) {
// process alpha
goNextApha(doc, event, cName, bCaps)
} else {
// process as number
AutoTab(doc, event, cNext)
}
return;
}
// --- end code --- document level script

// --- start code keystroke

//for numeric field
goNext(this, event, "NextField2");
// or
AutoTab(this, event, "NextField2");


//for Alpha field to caps
goNext(this, event, "NextField2", true, true);
// or
goNextAlpha(this, event, "NextField2", true, true);
// --- end code keystroke

George Kaiser