imsodarnpretty
07-23-2002, 06:40 AM
this code is supposed to validate first if there is a value on the retrieved txtbox value...and if there is a value, it will be stored on a cookie and submit the form to a pop up window:
<SCRIPT LANGUAGE="JavaScript">
<!--
cookie_name = "dataCookie";
var YouEntered;
var expireDate = new Date();
expireDate.setMonth(expireDate.getMonth() + 1);
window.name = "mymainwindow";
function passData(data)
{
if (document.formcookie.emailadd.value == "") alert ("Please enter an email address!")
else
{ YouEntered=document.formcookie.emailadd.value;
document.write(document.cookie)=cookie_name+"="+YouEntered+";expires=" + expireDate.toGMTString();
windowHandle = window.open('ecard_email_detect.asp' + '?' + data,'windowName','resizable=no,width=520,height=250');
return true;
}
}
//-->
</SCRIPT>
and this code triggers it:
<form name="formcookie" method="post" action="ecard_email_detect.asp" target="newWindow" onSubmit="return false">
<input type="text" name="emailadd" size="20">
<INPUT TYPE="submit" class="button" VALUE="Subscribe" onClick="passData(this.form.emailadd.value);" name="Submit">
</form>
but everytime i test it, it says 'type mismatch return' and its on line 287 (but i only have till line 278)...ive been debugging it but no success...
<SCRIPT LANGUAGE="JavaScript">
<!--
cookie_name = "dataCookie";
var YouEntered;
var expireDate = new Date();
expireDate.setMonth(expireDate.getMonth() + 1);
window.name = "mymainwindow";
function passData(data)
{
if (document.formcookie.emailadd.value == "") alert ("Please enter an email address!")
else
{ YouEntered=document.formcookie.emailadd.value;
document.write(document.cookie)=cookie_name+"="+YouEntered+";expires=" + expireDate.toGMTString();
windowHandle = window.open('ecard_email_detect.asp' + '?' + data,'windowName','resizable=no,width=520,height=250');
return true;
}
}
//-->
</SCRIPT>
and this code triggers it:
<form name="formcookie" method="post" action="ecard_email_detect.asp" target="newWindow" onSubmit="return false">
<input type="text" name="emailadd" size="20">
<INPUT TYPE="submit" class="button" VALUE="Subscribe" onClick="passData(this.form.emailadd.value);" name="Submit">
</form>
but everytime i test it, it says 'type mismatch return' and its on line 287 (but i only have till line 278)...ive been debugging it but no success...