smus Posted September 12, 2017 Share Posted September 12, 2017 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? Link to comment Share on other sites More sharing options...
iwato Posted September 12, 2017 Share Posted September 12, 2017 Is the following not a solution to your problem: https://www.w3schools.com/tags/att_button_formaction.asp Roddy Link to comment Share on other sites More sharing options...
smus Posted September 12, 2017 Author Share Posted September 12, 2017 25 minutes ago, iwato said: Is the following not a solution to your problem: https://www.w3schools.com/tags/att_button_formaction.asp Roddy No, it submits to another URL, but do not shows data in a different tab Link to comment Share on other sites More sharing options...
iwato Posted September 12, 2017 Share Posted September 12, 2017 (edited) 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 September 12, 2017 by iwato Link to comment Share on other sites More sharing options...
dsonesuk Posted September 12, 2017 Share Posted September 12, 2017 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['...']; Link to comment Share on other sites More sharing options...
smus Posted September 17, 2017 Author Share Posted September 17, 2017 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now