button like submit

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

button like submit

Post by shiznatix »

i have a form where when they click on a button a window opens but when i make that button a submit button it changes the page on on and opens the window but when i just make it a button it only opens the window but dosnt process any of the data in the form. how do i go about fixing that?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

I think you'll need to use some Javascript. Something like:

Code: Select all

onClick=&quote;window.open(); document.form.submit();&quote;
But obviously with working JS code..
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

ok well that kinda worked but how do i submit the data to the newly opened window instead of to the page its currently on?

o and document.form.submit() gives me a error but this.form.submit() does not
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

never mind i found out that you can do
<form action="page.php" target="new">
and it auto opens the new page submiting the data when you hit the submit button
Post Reply