Jump to content
smus

2 Submits in a form

Recommended Posts

I need two submit buttons in my form, first is going to show result in the same tab and another one is in another one.

<submit target="_blank">

is not correct. <target="_blank"> is for <form> tag, right?

Share this post


Link to post
Share on other sites

Have you tried  "./#name_of_tab"?

./  = same page

#  = some id attribute

name_of_tab =  the value of the id attribute

For example,

<div id='name_of_tab'>

This is my tab contents.

</div><!-- end div.#name_of_tab -->

DISCLAIMER:  I have never tried this, but if it works, why not?

Roddy

Edited by iwato

Share this post


Link to post
Share on other sites

The first form should submit to itself, on load, validate what is submitted including the submit button name, this means you create JavaScript code, through php, to open new window using window.open() to other page.

Transfer data:

either by sessions from page one, which is read through php page.

by querystring through url of window.open() function that takes you to second page, and let php read it through $_GET['...'];

Share this post


Link to post
Share on other sites

If not first form is going to submit to a current tab, the solution will be more simple and elegant. We just paste this string in <head> :

 <base target="_blank">

Voila and all our submits give a new tab with the form results!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×