[thelist] JS Form Submit and Popup window
CDitty
mail at redhotsweeps.com
Tue Jan 2 23:45:08 CST 2001
Jeff or anyone else...
Can someone look at this code and see what is wrong? I want to do a few
form checking then if everything is ok, open a new window with the new
page. Right now, it does the error checking and if everything is ok, it
opens 2 windows. One with nothing and the other has my new page on it.
Any tips?
Submit a form and send the user to another page.
<br>
<script language="javascript">
<!--hide
function query_validator(form){
if (form.emailaddr.value == ""){
alert('Email address required to play.');
form.emailaddr.focus();
return(false);
}else{
return(openWin(this.target,800,600,true));
}
function openWin(wName,wWidth,wHeight,wResize){
features =
'menubar=0,toolbar=0,location=1,directories=0,scrollbars=1,status=1,resizable='
+ ((wResize) ? 1 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ?
',height=' + wHeight : '');
popWin = window.open('',wName,features);
if(popWin.focus) { popWin.focus(); }
return true;
}
}
//-->
</script>
<form action="http://www.redhotsweeps.com/games/sc1/index.htm"
method="POST" TARGET="newWin" onsubmit="return query_validator(this)">
Email Address:<input type="text" name="emailaddr" value="">
<input type="Hidden" name="gameid" value="1"><br>
<center>
<input type="submit" name="Submit" value="submit">
</center>
</form>
Thanks
Chris
At 05:17 PM 1/1/01, you wrote:
>christopher,
>
>:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>: From: CDitty
>:
>: I am trying to design a form that will take a user's
>: email address and a id and submit that to a popup
>: window.
>:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>http://members.evolt.org/jeff/code/form_to_window/
>
>good luck,
>
>.jeff
>
>name://jeff.howden
>game://web.development
>http://www.evolt.org/
>mailto:jeff at members.evolt.org
>
>---------------------------------------
>For unsubscribe and other options, including
>the Tip Harvester and archive of TheList go to:
>http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list