I've created a function that checks form fields that only will have letters.
This is the script:
<script type="text/javascript" language="javas cript">
function validateString( field, msg, min, max) {
if (!min) { min = 1 }
if (!max) { max = 65535}
if (!field.value || field.value.len gth < min || field.value.max > max) {
alert(msg);
field.focus();
field.select();
return false;
}
return true;
}
</script>
How can I add code to this function that checks for whitespace...ex .
"\n\r\t"
I would also like to check for only letters in the fields and make sure no
numbers have been entered. Any help is appreciated. Thanks in advance.
-D-
This is the script:
<script type="text/javascript" language="javas cript">
function validateString( field, msg, min, max) {
if (!min) { min = 1 }
if (!max) { max = 65535}
if (!field.value || field.value.len gth < min || field.value.max > max) {
alert(msg);
field.focus();
field.select();
return false;
}
return true;
}
</script>
How can I add code to this function that checks for whitespace...ex .
"\n\r\t"
I would also like to check for only letters in the fields and make sure no
numbers have been entered. Any help is appreciated. Thanks in advance.
-D-
Comment