|
I'm having a problem getting validated form data to my asp script. If I don't validate, the data is passed with no problem. Once I check the form for user input, the asp script does nothing. Anyone have an idea? Listed here is my function CheckForm() and my Form ID. I'm using the same form field Name in my asp script. Does the variable name change once it is verified? Thanks for your help!
function CheckForm()
{
if (document.EmailForm.SenderName.value=="" || document.EmailForm.SenderName.value.indexOf(" ")==0)
{
alert("Please enter a value for Name.");
document.EmailForm.SenderName.focus();
return false;
}
else if (document.EmailForm.EmailAddress.value=="" || document.EmailForm.EmailAddress.value.indexOf(" ")==0)
{
alert("Please enter a value for email address.");
document.EmailForm.EmailAddress.focus();
return false;
}
else if (document.EmailForm.EmailAddress.value.indexOf(at) ==-1){
alert("You have forgotten an @ in the email address")
document.EmailForm.EmailAddress.focus();
return false;
}
else if (document.EmailForm.EmailAddress.value.indexOf(dot )==-1){
alert("You have forgotten a dot in the email address")
document.EmailForm.EmailAddress.focus();
return false;
}
else if (document.EmailForm.Subject.value=="" || document.EmailForm.Subject.value.indexOf(" ")==0)
{
alert("Please enter a value for Subject.");
document.EmailForm.Subject.focus();
return false;
}
else if (document.EmailForm.Message.value=="" || document.EmailForm.Message.value.indexOf(" ")==0)
{
alert("Please enter a value for Message.");
document.EmailForm.Message.focus();
return false;
}
return true
}
************************************
Form ID Code:
<form id="EmailForm" name="EmailForm" onsubmit="return CheckForm()" action="emailformconfirm1.asp" method="post">
|