Question : textboxes

this works fine for 4digit textboxes
when one textbox has 4digits, it goes to next textbox

I want to change to 6digit textboxes

tried replacing 4 with 6 and did not work


<?php
 
?>


<script language="javascript">
    function only(which, next, numberOfDigit,min,max) {
        which.value = which.value.replace(/\D/g,'');
        if( (which.value.length != numberOfDigit) || (parseInt(which.value)<min) || (parseInt(which.value)>max) ) {
            which.focus();    
        }
        else {
            document.getElementById(next).focus();
        }
    }
</script>


   Card Number<input type="text" name="card1" id="card1" size="4" maxlength="4" onkeyup="only(this, 'card2', 4, 0, 9999);" onblur="only(this, 'card2', 4, 0, 9999);" />
   -<input type="text" name="card2" id="card2" size="4" maxlength="4" onkeyup="only(this, 'card3', 4, 0, 9999);" onblur="only(this, 'card3', 4, 0, 9999);" />
   -<input type="text" name="card3" id="card3" size="4" maxlength="4" onkeyup="only(this, 'card4', 4, 0, 9999);" onblur="only(this, 'card4', 4, 0, 9999);" />
   -<input type="text" name="card4" id="card4" size="4" maxlength="4" onkeyup="only(this, 'month', 4, 0, 9999);" onblur="only(this, 'card1', 4, 0, 9999);" />

Answer : textboxes

Apologies, yes you are right. The control takes it, but there is still the max of 9999 to change to 999999.
1:
2:
3:
4:
   Card Number<input type="text" name="card1" id="card1" size="6" maxlength="6" onkeyup="only(this, 'card2', 6, 0, 999999);" onblur="only(this, 'card2', 6, 0, 999999);" />
   -<input type="text" name="card2" id="card2" size="6" maxlength="6" onkeyup="only(this, 'card3', 6, 0, 999999);" onblur="only(this, 'card3', 6, 0, 999999);" />
   -<input type="text" name="card3" id="card3" size="6" maxlength="6" onkeyup="only(this, 'card4', 6, 0, 999999);" onblur="only(this, 'card4', 6, 0, 999999);" />
   -<input type="text" name="card4" id="card4" size="6" maxlength="6" onkeyup="only(this, 'month', 6, 0, 999999);" onblur="only(this, 'card1', 6, 0, 999999);" />
Random Solutions  
 
programming4us programming4us