Hello,
I am trying to validate a form wherein someone will enter their first
and last name, fill out the form, then electronically "sign" at the
bottom. I want to confirm that the first and last names match in the
First & Last & Signature form fields. Here is the code I wrote, but
it doesn't work because indexof is supposed to be a string. What do I
need to do to fix this?
if (document.repFo rm.Signature.va lue.indexOf(Fir st) == -1 ||
document.repFor m. Signature.value .indexOf(Last) == "-1") {
alert("Signatur e does not match first and last name.");
document.repFor m.Signature.foc us();
return false;}
Thanks,
Jeremy
I am trying to validate a form wherein someone will enter their first
and last name, fill out the form, then electronically "sign" at the
bottom. I want to confirm that the first and last names match in the
First & Last & Signature form fields. Here is the code I wrote, but
it doesn't work because indexof is supposed to be a string. What do I
need to do to fix this?
if (document.repFo rm.Signature.va lue.indexOf(Fir st) == -1 ||
document.repFor m. Signature.value .indexOf(Last) == "-1") {
alert("Signatur e does not match first and last name.");
document.repFor m.Signature.foc us();
return false;}
Thanks,
Jeremy
Comment