Solved

On submit open a new window and pass form variables?

Posted on 2004-04-22
8
417 Views
Last Modified: 2013-12-24
Hi,

I have a form in my page, and I need to open a new window when a submit button clicked.
The form variables need to be passed too.

Anyone have a JavaScript that can do this?

Thanks
0
Comment
Question by:g118481
8 Comments
 
LVL 18

Expert Comment

by:Plucka
ID: 10887891
Hi g118481,

You don't need javascript, unless you want to do something special with the window.

All you need is to specify the target on the form and it will pop into a new window.

<form target="_blank" name="test">

Le me know if you need further assistance.

Regards
Plucka
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10887931
Plucka is right you don't need javascript to do this

you will nedd javascript if you want to change the form page on a successful submission
parent.location.href="path/to/newpage.cfm";

or if the new window is to be closed after a successful submission
place at bottom of page!! or set a timer to execute as a function

window.close(); //only works on child windows
0
 
LVL 17

Accepted Solution

by:
anandkp earned 150 total points
ID: 10891851
use javascript to open a new window ... give window a name there
<A HREF="##" onClick="window.open('popup.htm?Img=anand.jpg','popup','scrollbars=yes,resizable=yes,width=500,height=350,left=0,top=0');document.frm.submit();return false">

like the name here is "popup"

& have ur form like this ...
<form name="frm" action="popup" method="post">
;
;
;
;
</form>
0
 
LVL 1

Author Comment

by:g118481
ID: 10892061
Anandkp,

I like your suggestion.
Can you explain further?

Cheers
0
 
LVL 1

Author Comment

by:g118481
ID: 10892092
Anandkp,

How do I incorporate the link part of your suggestion to the submit button of my form on the main page?
I just don't understand what configuration you are suggesting.  Please explain further.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now