I have validation on a form so the user has to enter something in the fields:
What I want to do is validate the the Reference field so it only accepts the following format
000-000-000.
How do I do this?
I have been searching for examples but haven’t come across anything similar.
Thanks.
Code:
function CheckForm(Recall) {
if (Recall.Reference.value == "") {
alert("Please enter a value for the \"reference number\" field.");
Recall.Reference.focus();
return (false);
}
if (Recall.Registration.value == "") {
alert("Please enter a value for the \"Registration \" field.");
Recall.Registration.focus();
return (false);
}
if (Recall.Make.value == "") {
alert("Please enter a value for the \" Make \" field.");
Recall.Make.focus();
return (false);
}
return (true);
}
What I want to do is validate the the Reference field so it only accepts the following format
000-000-000.
How do I do this?
I have been searching for examples but haven’t come across anything similar.
Thanks.