Gunit2507
08-23-2004, 10:55 PM
I am VERY new to javacsript. I am validating a form onsubmit and then i want the new window to popup in a new winow... This is what i have:
<script language="JavaScript">
function validate(returnvalue)
{
//Validation Control Center
//Use validateNotEmpty(fieldname,errormessage) to check if the field is empty
//Use validateEMailCheck(fieldname,errormessage) to check if the email address is valid
//These must go inside if statement
var anError
if (validateNotEmpty(document.MailingList.Email.value,"You must enter your e-mail address")==false)
{
anError=true
}
else
{
if (validateEMailCheck(document.MailingList.Email.value,"You must enter a valid e-mail address for yourself")==false)
{
anError=true
}
else
{
if(document.MailingList.SportsMailing.checked==false && document.MailingList.GamingMailing.checked==false)
{
alert("You must choose at least one topic");anError=true;
}
}
}
if (anError==true)
{
return false;
}
else
{
open.window(' ','Mailing',"width=452,height=325,scrollbars=no")
return true;
}
}
But i can not get the action="" of the form to make it in a new window... is there a way of doing it!?
<script language="JavaScript">
function validate(returnvalue)
{
//Validation Control Center
//Use validateNotEmpty(fieldname,errormessage) to check if the field is empty
//Use validateEMailCheck(fieldname,errormessage) to check if the email address is valid
//These must go inside if statement
var anError
if (validateNotEmpty(document.MailingList.Email.value,"You must enter your e-mail address")==false)
{
anError=true
}
else
{
if (validateEMailCheck(document.MailingList.Email.value,"You must enter a valid e-mail address for yourself")==false)
{
anError=true
}
else
{
if(document.MailingList.SportsMailing.checked==false && document.MailingList.GamingMailing.checked==false)
{
alert("You must choose at least one topic");anError=true;
}
}
}
if (anError==true)
{
return false;
}
else
{
open.window(' ','Mailing',"width=452,height=325,scrollbars=no")
return true;
}
}
But i can not get the action="" of the form to make it in a new window... is there a way of doing it!?