[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.
<script language="javascript">
function query_validator(form){
         if (form.emailaddr.value == ""){
                 alert('Email address required to play.');

         function openWin(wName,wWidth,wHeight,wResize){
         features = 
+ ((wResize) ? 1 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ? 
',height=' + wHeight : '');
           popWin = window.open('',wName,features);
                 if(popWin.focus) { popWin.focus(); }
                 return true;

<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>
<input type="submit" name="Submit" value="submit">



At 05:17 PM 1/1/01, you wrote:
>: 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.
>good luck,
>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