The formaction attribute specifies the URL of a file that will process the input control when the form is submitted. The formaction attribute overrides the action attribute of the <form> element. This formaction attribute is used with type="submit" and type="image".
This example is an HTML form with two submit buttons, each with different actions:
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"> <input type="submit" formaction="http://www.w3schools.com/html/demo_admin.asp" value="Submit as admin"> </form> |
This should work with all major browsers.