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???

Kenny16301
Registered: Sep 3 2011
Posts: 6
Answered

Hi,
 
I want to be able to enter info and have it skip to the next field without me hitting enter or tab. I have 3 Fields named Tax.1 Tax.2 Tax.3 You would type only 1 character for each field. It will either be a number or a letter. Please help!!!!

My Product Information:
Acrobat Pro 8.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Accepted Answer
In Acrobat designed forms, not LiveCycle Designer, you can set the Maximum number of characters for the field and then use a custom JavaScript keystroke to test the length of the entered characters.

The document level script:

function goNext(item,event,cName){
AFNumber_Keystroke(0,0,0,0, "",true); // key stroke validation for number only
if(event.rc && AFMergeChange(event).length == event.target.charLimit)
item.getField(cName).setFocus();
}

Custom key stroke JavaScript:

goNext(this, event, "NextFieldName");

George Kaiser

Kenny16301
Registered: Sep 3 2011
Posts: 6
Would I be able to copy and past that formula into the field to make it work? Im not very familiar with how to write Java Script.

Thanks
Kenny
Kenny16301
Registered: Sep 3 2011
Posts: 6
Hi,

I did copy and past it into the fields and changed the name to the field Im using and it worked great. I should have mentioned that some fields are for numbers only and some are for letters. The format that is displayed above is for numbers only which is great. What would the format be for just letters. Thanks again!!
Kenny16301
Registered: Sep 3 2011
Posts: 6
Hi,

I set the character limit to 1. But I noticed that if a "W" is typed its smaller than the other letters. Is thier a fix to that. Kenny
try67
Expert
Registered: Oct 30 2008
Posts: 2398
The font size is probably set to Automatic, causing the "W" to appear smaller (since its wider than other letters).
You can either resize your fields, or set the font size to a fixed number.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Kenny16301
Registered: Sep 3 2011
Posts: 6
Hi,

I would like to make the field that Im typing in only do Upper Case Letters. I have provided the script that Im using in Acrobat 8.0 Any help would be appreciated.

Custome Format Script:

// Document-level function

function tab_next(next_field_name) {


// Move to next field if Enter key is pressed
// or the user has clicked outside of the field
// or if the number of character is the character limit
if (event.willCommit || AFMergeChange(event).length === event.target.charLimit) {
getField(next_field_name).setFocus();
}
}

Custome Keystroke Script:
// Autotab to the "Rank.1" field

tab_next("Rank.1");


Thanks!!
Kenny
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Are you getting any error messages?

I would start with the provided code and use the JavaScript documentation to see what each line does.

George Kaiser

Kenny16301
Registered: Sep 3 2011
Posts: 6
George,

Im not getting errors so far. Im able to enter into the fields and they tab to the next one but I would like to limit the fields to Upper case letters only. Is that possible and what would I have to enter to make that happen.

Thanks
Kenny
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You an use JavaScirpt's 'toUpperCase()' method to convert any string's value to upper case letters.

George Kaiser