Menu
I am validating that a field called “number” is entered on my form with the following javascript code:
function FormValidator(theForm) {
if (theForm.number.value == “”) {
alert(“Please enter number.”);
theForm.number.focus();
return (false);
}
return (true);
}
Can anyone help me with the code required to extend this validation to ensure that only numbers (0-9) are entered i.e. no alpha or other characters and no blank spaces. Additionally (but not as important) how can I ensure that at least 6 but no more than 10 numbers are entered.
Many Thanks
PaulB