Changing focus when text length reaches limit
I need to change the focus of a text box when its text length reaches 2.
Three text boxes:
1: [ ] 2: [ ] 3: [ ]
Now when the user types in box 1 and the text length reaches 2 it should set focus to the second.
I tried this:
if (document.form.text1.length == 2) document.form.text2.focus();
But it didnt work.