focus on another text box when first text box reaches at max
Posted: Thu Jan 24, 2008 2:11 am
Hello friends
i have a problem with javascript
i have follwowing code on my html page
these three text boxes are for entering the phone number in 3-3-4 digits they are working fine when we put the numbers first time but when we dekete the nymbers already entered than the tabindex goes to another text box which should not happen
please give me any solution
thanks.
i have a problem with javascript
i have follwowing code on my html page
Code: Select all
<input type="text" value="{wphone1}" name="work_ph1" id="work_ph1" onkeyup="return numcheck('work_ph1')" size="3" maxlength="3" onkeypress="Javascript:if(getElementById('work_ph1').value!='' || this.value.length>2)document.getElementById('work_ph2').focus();" onblur="setVisibility('hint_workphone')" onfocus="setVisibility('hint_workphone')"/> -
<input type="text" value="{wphone2}" name="work_ph2" id="work_ph2" onkeyup="return numcheck('work_ph2')" size="3" maxlength="3" onkeypress="Javascript:if(this.value.length>2)document.getElementById('work_ph3').focus();" onblur="setVisibility('hint_workphone')" onfocus="setVisibility('hint_workphone')"/> -
<input type="text" value="{wphone3}" name="work_ph3" id="work_ph3" onkeyup="return numcheck('work_ph3')" size="4" maxlength="4" onblur="setVisibility('hint_workphone')" onfocus="setVisibility('hint_workphone')"/>please give me any solution
thanks.