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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to tab from one text box to another via code 1

Status
Not open for further replies.

romh

Programmer
Jan 3, 2003
297
US
I need to tab over via code from one text box to another once the maxiumum number of characters have been reached in a certain text box. I have searched but haven;t found anything. Thanks alot.

 
this is a sloppy telephone one that I use...
Code:
function formatPhone() {
  var x = window.Form1.txtPhone.value.length;

  if (x == 3) {
   window.Form1.txtPhone.value = window.Form1.txtPhone.value + '.';
  } else if (x == 7) {
   window.Form1.txtPhone.value = window.Form1.txtPhone.value + '.';
  } else if (x > 11) {
   window.Form1.txtPhone.value = window.Form1.txtPhone.value.substring(0,12);
   window.Form1.txtFax.focus();
  }
}

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top