English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <input> formaction attribute

The formaction attribute specifies the URL of the file that will handle the input controls when the form is submitted, the formaction attribute will override the action attribute of the <form> element.

 HTML <input> tag

Online Example

An HTML form with two submit buttons (can be submitted to different actions):

<!DOCTYPE html>
<html>
<head>
<title>HTML: <input> formaction attribute - Basic Tutorial Website(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit to action_page1><br>
  <input type="submit" formaction="action_page2.php" value="Submit to action_page2">
</form>
</body>
</html>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 10Firefox, Opera, Chrome, and Safari all support the formaction attribute.

Note:Internet Explorer 9 and earlier versions do not support the formaction attribute of the <input> tag.

Definition and usage

The formaction attribute specifies the URL of the file to be processed when the form is submitted.

The formaction attribute overrides theactionattribute.

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

HTML 4.01 and HTML5Difference between

The formaction attribute is an HTML5 The new attribute added in

Syntax

        <input formaction="URL">

Attribute value

ValueDescription
URLSpecifies the URL to be used for processing the input control file when the form is submitted.
Possible values:
Absolute URL - The complete address of a page (such as HREF = 'http:)//www.example.com/formresult.php”)
Relative URL - Points to a file within the current website (such as HREF = 'formresult.php')
 HTML <input> tag