Submitting form to a new window

Submit form to new window
<input type='submit' value='Open default action file test5.php' 
onclick="this.form.target='_blank';return true;">
A form can be submitted to different window or to a new window. The action page of the form can be opened in a new window by passing all the form element values to it. This is required in different occasions where the visitor can see check and decide on which page to use.
Submitting form to new window and multiple submit buttons to post data to different target pages

This is done where graphs are to be generated on the fly based on the selection of options within a form by the visitor. For example, we are showing price trend for different months where visitor has to select month from a list. After selection of the month we can submit the form to a new window to show the graph of the price trend. Visitor can close the graph window and select another month to see the price trend. So in the main window the form remains constant (open ) and the value is taken to a new window.

Here is the demo to open a new window ( new tab ) with the form value.


Here is the code for the above form with the submit button.

<form name=f1 method=post action=test5.html>
<input type=text name=name value='plus2net'>
<input type='submit' value='Open default action file test5.php'
onclick="this.form.target='_blank';return true;">
</form>
Submit form data to two different Windows Code for Back to Previous Page
HTML Form

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Mohamed Osama

    25-11-2015

    Thanks it's works fine with me :) to open new tab after submit
    amlan roy

    22-08-2016

    Thank u soo much ..

    29-03-2021

    Finally, my problem was solved.

    28-01-2023

    You can also put `target="_blank"` in the form tag.

    <form action=.. target="_blank">

    This doesn't use any javascript.



    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer