Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
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
Former Community Member

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

Former Community Member

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
Former Community Member

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,

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----