"Jay Villa" <ja******@community.nospam> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
I have a SSN Field which include 3 text boxes. How do I move the focus
from one box to another as soon as user enter the max characters in the text
box. For example:
when users enter 123 in the first text box of ssn
control should move to next text box .....
-Thanks
Jay
This isn't an ASP (server-side) question.
Here's a client-side JavaScript solution:
<form>
<input type="text" name="ssn1" id="ssn1"
size="3" maxlength="3"
onkeyup="if (this.value.length == 3)
document.getElementById('ssn2').focus();">
<input type="text" name="ssn2" id="ssn2"
size="2" maxlength="2"
onkeyup="if (this.value.length == 2)
document.getElementById('ssn3').focus();">
<input type="text" name="ssn3" id="ssn3"
size="4" maxlength="4"
onkeyup="if (this.value.length == 4)
document.getElementById('butt').focus();">
<input type="button" name="butt" value="">
</form>