sanjuT
05-02-2003, 09:21 AM
this script checks if the user has entered 3 letters followed by 6 numbers in the textbox:
<input type="text" name="AccNo" onChange="javascript:
if (!/^[a-z]{2,5}[0-9]{6}$/i.test(this.value)) {
alert('Invalid account number!');
this.value='';
this.focus();
return false;
}
return true;">
How can this script be altered to check if the user has entered a number, and if that number is at least 12 (less than 12 would trigger the alert).
THANKS!!!
<input type="text" name="AccNo" onChange="javascript:
if (!/^[a-z]{2,5}[0-9]{6}$/i.test(this.value)) {
alert('Invalid account number!');
this.value='';
this.focus();
return false;
}
return true;">
How can this script be altered to check if the user has entered a number, and if that number is at least 12 (less than 12 would trigger the alert).
THANKS!!!