Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How do I auto tab through form fields

Avatar

Level 2

I want to place the javascript in the change field, correct?

I have tried

var f1 = this.getField();
if (f1.length == 1){
f1 = _2_3.getField();
}

_2_3 is the name of the next text box

this still does not work

Any help?

1 Accepted Solution

Avatar

Correct answer by
Level 10

If you are building the form using LiveCycle Designer then that script is using the wrong model. If you are expecting to autotab to the next field when the current field is full here is one way to do it. You coudl trap the code that goes into a field as it is being typed. You can test its length and if it is the length you are looking for then you can move the cursor.....something like this:

var temp = xfa.event.newText;

if (temp.length == 3){

     xfa.host.setFocus("TextField2")

}

Hope that helps

Paul

View solution in original post

5 Replies

Avatar

Level 10

Are you building the form with LiveCycle Designer or Acrobat?

The code you pasted will not move the cursor .....what is it you are trying to do?

Paul

Avatar

Level 2

I have adobe acrobat pro and livecycle. I have been trying to use either. I know java and C++ but have never used javascript.

I would like the user of the form to fill the field out with one character and it auto tab to the next field.

The code I put was based on examples I had found online. I have limited knowledge about the javascript methods.

Avatar

Correct answer by
Level 10

If you are building the form using LiveCycle Designer then that script is using the wrong model. If you are expecting to autotab to the next field when the current field is full here is one way to do it. You coudl trap the code that goes into a field as it is being typed. You can test its length and if it is the length you are looking for then you can move the cursor.....something like this:

var temp = xfa.event.newText;

if (temp.length == 3){

     xfa.host.setFocus("TextField2")

}

Hope that helps

Paul

Avatar

Level 1

Lets say I want to auto tab when a field that holds 40 char is full to the next field and I want to take a partial word to the next field as a continuation, so as to not break a word in half?  Is this possible first of all and if so, what might the java code be?  I am using Adobe Acrobat.

Thanks,