Expand my Community achievements bar.

SOLVED

Have fields auto tab to the next field when the limited characters have been reached

Avatar

Level 2

I have text fields for our account numbers and it is a pain to enter one number and then tab, and enter another number and tab.  I have set the limit to 1 character and would like the form to auto tab to the next account field and continue with all of the account numbers.

Thank you,

EC

1 Accepted Solution

Avatar

Correct answer by
Level 6

Check the attached updated form for auto tab. script on each text field level on CHANGE event and method in variables.
Make sure all the text fields in sequence in hierarchy as place on page (right now some are not in sequence).

View solution in original post

8 Replies

Avatar

Level 6

I've used formCalc:   xfa.host.setFocus("TextField_name") to move to the next text field but it's still not fully "auto tabbing."  Used for entering social security numbers on a form similar to your example

Avatar

Correct answer by
Level 6

Check the attached updated form for auto tab. script on each text field level on CHANGE event and method in variables.
Make sure all the text fields in sequence in hierarchy as place on page (right now some are not in sequence).

Avatar

Level 2

Thank you so much, that is exactly what I was wanting to happen!

Etta Cay Dixon

Willamalane Park and Recreation District

HR/Payroll Specialist

541-736-4035

Avatar

Level 2

I applied your formula to this form, but I obviously have missed something, because this form will not auto tab. Since I really do not understand Hierarchy, that might be what is holding up the formula to work. Your help would be greatly appreciated!

Thank you,

EC

Willamalane

541-736-4035

Avatar

Level 6

Every thing fine, but the function itself missing in the script object.

copy the below function in ur script variables (F.#variables[0].CommonScripts).

function autoTab(oCurrField, sCurrFieldVal)
{
try
{
  var currFieldMaxChars = oCurrField.value.text.maxChars;

  if ( currFieldMaxChars != 0 )
  {
   if ( sCurrFieldVal.length == currFieldMaxChars )
   {
    var sNextField = oCurrField.traversal.resolveNode("#traverse").ref;

    if ( sNextField != null )
    {
     xfa.host.setFocus( sNextField );
    }
   }
  }
}
catch(e){}
}

comming to Hierarchy

please check the taborder in the form.

Tab out from 2nd row total price column and it is not goin to next field it is goin to some other bcz tab order is not correct.

if u take TextField1[0] to TextField2[9] the order in Hierarchy window is sequence but fields u place on the form page not in sequence, better to make consistent to avoid confusion.

Avatar

Level 2

You have lost me. I do not see how I can view or add this script to an object. When I view the hierarchy I see (F.#variables.CommonScript), but do not know how to apply the script you have given me to the script varialbes.

Thank you,

EC Willamalane

541-736-4035

Avatar

Level 2

Good morning,

I had inserted a comment and then deleted it. Now everytime I open the document it opens in Comment view. I have changed the view 3 different ways, but it still opens up in comment view. How do I get the document to open in full view again?

Thank you for your help,

Etta Cay Dixon

Willamalane Park and Recreation District

HR/Payroll Specialist

541-736-4035