Expand my Community achievements bar.

Telephone Number Jump

Avatar

Former Community Member
I want to be able to create 3 different textfields for a telephone number where after the first three digits of the area code are entered it automatically jumps to the next textfield without missing a beat so the user can just enter the number normally without any tabbing or mouse.

I just don't know what event to put my code into since "change" event doesn't work.
3 Replies

Avatar

Former Community Member
You can try the Calculate event, not sure if it updates on each keypress though. If none of those options work, you might have to trap the keypresses through javascript instead and that's not as funny as it would be to simply use change/calculate...

Avatar

Former Community Member
say the fields are called field1, field2, field3



In the CHANGE event of field1, you can add the following code



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

xfa.host.setFocus("field2");



Add the same code in field2 but change setFocus("field2") to

setFocus("field3");

Avatar

Former Community Member
BRILLIANT! So thats how the event model works, the example in designer help wasn't too forthcoming.

Thank you so much, that was fast!



Kyle