This one has me vexed. I am trying to validate two fields, name and email address, if the validation passes then send an email with both, and then open a form which has a download link on it. I want to have these three actions all performed with the same 'submit' button (one click of the mouse). Here's the code that I have but it's not working. Can anyone provide some tips or a healthy push in the right direction?? Much thanks.
<SCRIPT LANGUAGE="javascript">
<!--
function verify() {
obj = document.forms[0]; // Assuming this is the first form on the page
if (obj.FName.value == "") {
err = obj.FName;
} else if (obj.Email.value == "") {
err = obj.Email;
} else {
obj.submit();
}
alert("Please fill in all fields.");
eval(err).focus();
}
//-->
</SCRIPT>
.
.
.
<FORM ACTION="mailto:info@wizdomworks.us" METHOD="POST" onSubmit="return confirm('Thank you.')">
<PRE> Name: <INPUT TYPE="TEXT" NAME="Fname" SIZE="40"></PRE>
<PRE> E-mail: <INPUT TYPE="text" NAME="Email" SIZE="40"></PRE>
<tr>
<input type="button" value="Submit" onClick="verify()"
href=" height=40 width=100 >
</tr>
<SCRIPT LANGUAGE="javascript">
<!--
function verify() {
obj = document.forms[0]; // Assuming this is the first form on the page
if (obj.FName.value == "") {
err = obj.FName;
} else if (obj.Email.value == "") {
err = obj.Email;
} else {
obj.submit();
}
alert("Please fill in all fields.");
eval(err).focus();
}
//-->
</SCRIPT>
.
.
.
<FORM ACTION="mailto:info@wizdomworks.us" METHOD="POST" onSubmit="return confirm('Thank you.')">
<PRE> Name: <INPUT TYPE="TEXT" NAME="Fname" SIZE="40"></PRE>
<PRE> E-mail: <INPUT TYPE="text" NAME="Email" SIZE="40"></PRE>
<tr>
<input type="button" value="Submit" onClick="verify()"
href=" height=40 width=100 >
</tr>