The formtarget
attribute on an input element specifies where to display the response after form submission, overriding the target
attribute of the <form>
element. It works with submit
and image
input types.
Example
A form featuring two submit buttons, each directing responses to different target windows.
<form action=”/action_page.php”> <label for=”fname”>First name:</label> <input type=”text” id=”fname” name=”fname”><br><br> <label for=”lname”>Last name:</label> <input type=”text” id=”lname” name=”lname”><br><br> <input type=”submit” value=”Submit”> <input type=”submit” formtarget=”_blank” value=”Submit to a new window/tab”> </form> |
The formnovalidate
attribute on an input element prevents validation during form submission, overriding the novalidate
attribute of the <form>
element. It applies only to submit
input types.
Example
A form containing two submit buttons, one subjected to validation and the other not.
<form action=”/action_page.php”> <label for=”email”>Enter your email:</label> <input type=”email” id=”email” name=”email”><br><br> <input type=”submit” value=”Submit”> <input type=”submit” formnovalidate=”formnovalidate” value=”Submit without validation”> </form> |