Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Autotab - is it possible?

Avatar

Former Community Member
Does anyone know how to enable autotabbing between text fields for forms created using livecycle? I've tried a number of different scritps with no success.



Thanks in advance
6 Replies

Avatar

Level 9
Hi

I presume you want to do something where once the field is "full", it automatically tabs to the next field.

I think you should be able to do this (although I haven't actually tried it) but adding a SetFocus call on the "Full" event. Note that the parameter for SetFocus is a String containing the som expression of the field you want to set focus to. You will also have to set the maximum number of characters in the field.

Howard

http://www.avoka.com

Avatar

Former Community Member
Hi Howard,



After a few attempts & with some additional advice I've managed to crack it. Thanks..

Avatar

Former Community Member
Can you share your script to do so???



Thanks!!!

Avatar

Former Community Member
This may not be exactly what the original poster had in mind... But I needed to skip a field in the tab order. I put the following JavaScript in the enter event of the field I wanted skipped:



xfa.host.setFocus(xfa.resolveNode("next_field"));



where "next_field" is the name of the field the cursor should go to.



Hope that's helpful--



Kathryn

Avatar

Former Community Member
Kathryn's example does work, but has the same problem as the FormCalc function does. The text will lose a character keystroke when the setFocus is applied.



The alternative way to do this in FormCalc is: xfa.host.setFocus("NextField")



Does anybody know how to get around the character loss?

Avatar

Level 1
If you have a set character length for your entry this will work on the change event:



if (xfa.event.newText.length == 3){

xfa.host.setFocus(next);

}



where "3" is the length to autotab at and "next" is the name of the field to tab to.



To bad they made the Full event useless.



JaKoB