HTML <input> formaction Attribute

Definition and Usage

formaction attribute of the <form> element, which specifies the URL to process the input control's file when the form is submitted.

formaction attribute overrides the action attribute

Note:formaction attributes correspond to type="submit" and type="image" Used together.

Example

HTML form with two submit buttons, set with different action URLs:

<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" formaction="/action_page2.php" value="Submit to another page">
</form>

Try It Yourself

Syntax

<input formaction="URL">

Attribute Value

Value Description
URL

Specifies the URL of the file that will process the input controls when the form is submitted.

Possible values:

  • Absolute URL - The complete address of the page (e.g., href="http://www.example.com/formresult.asp")
  • Relative URL - Points to a file within the current site (e.g., href="formresult.asp")

Browser Support

The numbers in the table indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 Support 5.1 10.6