I'm trying to get the script to alert you of certain blank fields when
you submit the form, but it just doesn't work, and I can't see why. By
all appearances it should be working.
But I get no errors, and then you SUBMIT it just goes right on to the
next page completely bypassing the validation.
What am I doing wrong? What am I missing?
If someone could give me a clue, I'd appreciate it!
Below is the JS and the relavent parts of the form.
Thanks!!
Liam
<script language=JavaSc ript>
<!-- Begin
function ValidateE1() {
var FieldList = "";
if (document.f1.to email.value.len gth < 2 ){
FieldList = "To Email\n";
}
if (document.f1.fr omemail.value == "") {
FieldList = FieldList + "From Email\n";
}
if (document.f1.ms g.value == "") {
FieldList = FieldList + "Message\n" ;
}
if (FieldList != "") {
alert("We did not get all the information we need from you.\n\n
Please fill in the following field(s):\n\n" + FieldList);
return false;
} else {
document.f1.sub mit();
}
}
// End -->
</script>
--SNIP--
<form name="f1" id="f1" method="post" action="emailer proc.bkk"
onSubmit="retur n ValidateE1();" >
--SNIP--
<td valign="top"><i nput name="toemail" id="toemail" type="text"
size="40">
<span class="labelBlu e"><br>^-- Recipient's E-mail
address</span> </td>
--SNIP--
you submit the form, but it just doesn't work, and I can't see why. By
all appearances it should be working.
But I get no errors, and then you SUBMIT it just goes right on to the
next page completely bypassing the validation.
What am I doing wrong? What am I missing?
If someone could give me a clue, I'd appreciate it!
Below is the JS and the relavent parts of the form.
Thanks!!
Liam
<script language=JavaSc ript>
<!-- Begin
function ValidateE1() {
var FieldList = "";
if (document.f1.to email.value.len gth < 2 ){
FieldList = "To Email\n";
}
if (document.f1.fr omemail.value == "") {
FieldList = FieldList + "From Email\n";
}
if (document.f1.ms g.value == "") {
FieldList = FieldList + "Message\n" ;
}
if (FieldList != "") {
alert("We did not get all the information we need from you.\n\n
Please fill in the following field(s):\n\n" + FieldList);
return false;
} else {
document.f1.sub mit();
}
}
// End -->
</script>
--SNIP--
<form name="f1" id="f1" method="post" action="emailer proc.bkk"
onSubmit="retur n ValidateE1();" >
--SNIP--
<td valign="top"><i nput name="toemail" id="toemail" type="text"
size="40">
<span class="labelBlu e"><br>^-- Recipient's E-mail
address</span> </td>
--SNIP--
Comment