Link to home
Start Free TrialLog in
Avatar of g118481
g118481

asked on

On submit open a new window and pass form variables?

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
Avatar of Plucka
Plucka
Flag of Australia image

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
Avatar of James Rodgers
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
ASKER CERTIFIED SOLUTION
Avatar of anandkp
anandkp
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of g118481
g118481

ASKER

Anandkp,

I like your suggestion.
Can you explain further?

Cheers
Avatar of g118481

ASKER

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.