View Single Post
Old 02-13-2013, 04:22 AM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
By the by, you could get rid of those useless id's in the fields, you know.
Code:
function moveMax(pfield,nfield)
{
  if(pfield.value.length >= pfield.maxLength)
   {
       pfield.form[nfield].focus();
   }
}

//inputs
<input type="text" name="domainIPa" value="" size="2" maxlength="3" onkeyup="moveMax(this,'domainIPb');" /> -
<input type="text" name="domainIPb" value="" size="2" maxlength="3" onkeyup="moveMax(this,'domainIPc');" /> -
<input type="text" name="domainIPc" value="" size="2" maxlength="3" onkeyup="moveMax(this,'domainIPd');" /> -
<input type="text" name="domainIPd" value="" size="2" maxlength="3" onkeyup="moveMax(this,'domainIPa');" />
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
durangod (02-13-2013)