Latest web development tutorials
 

HTML <input> formaction Attribute

< HTML <input> tag

Example

An HTML form with two submit buttons, with different actions:

<form action="demo_form.asp">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit"><br>
  <input type="submit" formaction="demo_admin.asp" value="Submit as admin">
</form>
Try it Yourself »

Definition and Usage

The formaction attribute specifies the URL of the file that will process the input control when the form is submitted.

The formaction attribute overrides the action attribute of the <form> element.

Note: The formaction attribute is used with type="submit" and type="image".


Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Attribute
formaction 9.0 10.0 4.0 5.1 10.6

Differences Between HTML 4.01 and HTML5

The formaction attribute is new in HTML5.


Syntax

<input formaction="URL">

Attribute Values

Value Description
URL Specifies the URL of the file that will process the input control when the form is submitted.

Possible values:

  • An absolute URL - the full address of a page (like href="http://www.example.com/formresult.asp")
  • A relative URL - points to a file within the current site (like href="formresult.asp")

< HTML <input> tag