holyearth
07-10-2007, 01:21 AM
The script below shows an error if the digit count is less than four or more than 5 ...
function validate2(form) {
if (form.pin.value.search( /^[0-9]{4}$/ ) == -1) {
alert('Please check your pin code and try again.');
form.pin.focus();
return false;
}
}
How can I change it so that it ONLY accepts 4, 5, or 6 digits long
function validate2(form) {
if (form.pin.value.search( /^[0-9]{4}$/ ) == -1) {
alert('Please check your pin code and try again.');
form.pin.focus();
return false;
}
}
How can I change it so that it ONLY accepts 4, 5, or 6 digits long