|
Changing focus when text length reaches limit
I need to change the focus of a text box when its text length reaches 2.
I.e.:
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:
<input name="text1" onChange="javascript:
if (document.form.text1.length == 2) document.form.text2.focus();
">
But it didnt work.
|