yombull
06-08-2004, 02:49 PM
I need to combine these three functions into one function so that it will work on the form when the submit button is clicked. I can get each function to work individually but I get errors when I try to use all of them. I have tried several different ways (guesses) to try and combine them into one function but my lack of javascript knowledge only creates frustration and more errors. Any help is appreciated.
function IGI_validate()
{
if ( (document.subscription.Name.value == '')
|| (document.subscription.Email.value == '')
|| (document.subscription.EmailConfirm.value == ''))
{
alert("Please fill out the form fields completely.")
return false
}
}
function emailcheck() {
var e=document.subscription.Email.value
if ((e.indexOf("@")==-1)||
(e.indexOf(".")==-1))
{
alert("Please input a valid email address!")
document.subscription.Email.focus()
}
}
function emailsMatch(document.subscription.Email.value,document.subscription.EmailConfirm.value)
{
if (document.subscription.Email.value != document.subscription.EmailConfirm.value)
{
alert("You're Email Addresses do not match!");
return false;
}
return true;
}
Thanks for your help!
function IGI_validate()
{
if ( (document.subscription.Name.value == '')
|| (document.subscription.Email.value == '')
|| (document.subscription.EmailConfirm.value == ''))
{
alert("Please fill out the form fields completely.")
return false
}
}
function emailcheck() {
var e=document.subscription.Email.value
if ((e.indexOf("@")==-1)||
(e.indexOf(".")==-1))
{
alert("Please input a valid email address!")
document.subscription.Email.focus()
}
}
function emailsMatch(document.subscription.Email.value,document.subscription.EmailConfirm.value)
{
if (document.subscription.Email.value != document.subscription.EmailConfirm.value)
{
alert("You're Email Addresses do not match!");
return false;
}
return true;
}
Thanks for your help!