Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Focus Text Box 1

Status
Not open for further replies.

FRANDAZZO

Programmer
Nov 29, 2000
60
US
Hello all. On my form i have my phone number field broken into 3 text boxes.
1- area code = txtArea
2- first 3 digits = txtPhone1
3- last 4 digits = txtPhone2

how do i from on text box after the user is filling the area code field our when the length is = 3 to automatically set the focus to the next text box. I wrote this a long time ago and only used it once. Tell me what I am doing wrong:
<input type=&quot;text&quot; name=&quot;txtArea&quot; onkeypress=&quot;if(this.length ==3){document.frmName.txtPhone1.focus()}&quot;>

Thanks,

Frandazzo
 
onkeypress=&quot;if(this.value.length == 3){document.frmName.txtPhone1.focus()}&quot; adam@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top