Submitting form to a new window

Submit form to new window
<input type='submit' value='Open default action file test5.php' 
onclick="'_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="'_blank';return true;">
Submit form data to two different Windows Code for Back to Previous Page


* indicates required
Subscribe to plus2net

    Mohamed Osama


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


    Thank u soo much ..


    Finally, my problem was solved.


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

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

    This doesn't use any javascript.

    Post your comments , suggestion , error , requirements etc here

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