Latest web development tutorials

HTML input formaction property

HTML input Tag Reference HTML <input> tag

Examples

With two submit buttons HTML forms (different action values):

<form action="demo-form.php">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="提交"><br>
<input type="submit" formaction="demo-admin.php" value="提交">
</form>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Firefox, Opera, Chrome and Safari support formaction property.

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


Definition and Usage

URL formaction attribute specifies the input control process when the form submissions.

formaction property overrides <form> element's action attribute.

Note: formaction property applies to type = "submit" and type = "image".


Differences between HTML 4.01 and HTML5

formaction attribute is new in HTML5 attributes.


grammar

<input formaction=" URL ">

Property Value

描述
URL 规定当表单提交时处理输入控件的文件的 URL。

可能的值:

  • 绝对 URL - 某个页面的完整地址(比如 href="http://www.example.com/formresult.html")
  • 相对 URL - 指向当前站点内的一个文件(比如 href="formresult.html")


HTML input Tag Reference HTML <input> tag