Form submitting data to new window and to two different pages

We can use two different buttons to submit the form to two different pages. One of the buttons can submit the form in a new window. You can read the article on how to open the action page of the form in new window. This is required in different occasions where the visitor can see check and decide on which page to use.

We can use the same form to submit to two different pages. The demo below will submit a form to two different pages.

For example we can show a printer friendly page to the visitor on its entered value in a new window. The visitor can check the values in new window and close it also. Again the visitor can do changes in main window and check the printer friendly page. Once satisfied, the visitor can finally submit the page for processing. Here is the example showing two buttons, one is submitting the form to same page and other is submitting to a new page by opening a new window.

You can see the two buttons below and one will open the test5.html page in this window and the other button will open test6.html in a new window ( keeping this window in same page ).

Here is the demo with two submit buttons to submit form to two different pages.

Here is the code for the above form with the submit button.
<form name=f1 method=post action=test5.php>
<input type=text name=name value='plus2net'>
<input type='submit' value='Open default action file test5.php' onclick="'_blank';return true;">
<input type='submit' value='Open test6.php' onclick="f1.action='test6.php';  return true;">



nice help me alot thanks


very nice helped me alot thx


You are the best


this is very useful thanks i got my problem solution from here ..


Yupp, it helped to solve my problem. Thanks!


thanks man! :)


this is very useful thanks i got my problem solution from here ..
Thank you so much..... :)
Keep us updating such nice codes

12-11-2018 helps me a lot if......Can it redirect with _POST method will all the form field name? If another php want to POST all form field.


You can add all form field names to the form. After receiving you can redirect to any page.


this is genius, thanks a lot.

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-2021 All rights reserved worldwide Privacy Policy Disclaimer