Attribute: Formtarget

The formtarget attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. This attribute overrides the target attribute of the <form> element and can be used with type="submit" and type="image".

This example is a form with two submit buttons, each with a different target window:

HTML file: Displayed by browser:
<form action="http://www.w3schools.com/html/action_page.php">
First name: <input type="text" name="fname">
<br />
<br />Last name: <input type="text" name="lname">
<br />
<br /><input type="submit" value="Submit as normal">
<br />
<br /><input type="submit" formtarget="_blank"
value="Submit to a new window">
</form>
First name:

Last name:



This should work with all major browsers.

Back button Table of Contents Next button