[Javascript] How can I include form values in a javascript window.open?

Rodney Myers rodney at aflyingstart.net
Fri Nov 9 08:49:45 CST 2001


Garry

How about


     <FORM name="main" METHOD="GET"
onSubmit="MM_openBrWindow('dummy.htm','CARDS','scrollbars=yes,resizable=
yes,width=640,height=600')" ACTION="inputuserdetails.cgi" TARGET="CARDS">

You may need to pay around with the dummy.htm url - which if used should represent a
real placeholding file, and preferably a small one already in browser cache, since
there is a danger of contention for the window which can crash some browsers.

You might try a button in the form, with this form tag at the top

     <FORM name="main" METHOD="GET"  ACTION="inputuserdetails.cgi" TARGET="CARDS">

<input type="button" value="Submit"
onClick="MM_openBrWindow('dummy.htm','CARDS','scrollbars=yes,resizable=
yes,width=640,height=600');setTimeout('window.document.main.submit()',2000)" >

This gives the window 2 seconds to open and get dummy.htm (which may be a completely
blank bodied file) before any submission.

hth


Rodney

garry taylor wrote:

> Hi,
>         As a Javascript newbie, this has me stumped:
>
> function MM_openBrWindow(theURL,winName,features) { //v2.0
>    window.open(theURL,winName,features);
> }
>
>      <FORM name="main" METHOD="GET"
> Submit="MM_openBrWindow('inputuserdetails.cgi','CARDS','scrollbars=yes,resizable=
> yes,width=640,height=600')">
>
> it opens the appropriate window, with the right URL, but no query string
> is included with the URL for all the form values, like it would be if I
> simply used a non-javascript form 'ACTION'.
>
> How can I include the query string taken from the form and pass it to
> inputuserdetails.cgi in the same way as you can with href in HTML or
> with ACTION in a form?
>
> Thanks in advance
>
> Garry
>
> Answers to email address appreciated.
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript

--
Shop at ssistant Add-ons and Developer Workshops
http://www.aflyingstart.net/addons/

Enquiries regarding Shop at ssistant Classic training :
Call 01256 880770

Rodney Myers
Based in Oxford, England
Technical Director, Shop at ssistant eCommerce Solutions





More information about the Javascript mailing list