On submit open a new window and pass form variables?

Posted on 2004-04-22
Medium Priority
Last Modified: 2013-12-24

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?

Question by:g118481
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Expert Comment

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.

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

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
LVL 17

Accepted Solution

anandkp earned 600 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">

Author Comment

ID: 10892061

I like your suggestion.
Can you explain further?


Author Comment

ID: 10892092

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.

Featured Post

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

741 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