HTML button formaction property
Examples
Submit a form with two buttons (with a different action), first submit button to submit the form data to "demo_form.html", the second submit button to submit the form data to "demo_admin.html":
<form action="demo_form.html" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<button type="submit">提交</button><br>
<button type="submit" formaction="demo_admin.html">提交</button>
</form>
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<button type="submit">提交</button><br>
<button type="submit" formaction="demo_admin.html">提交</button>
</form>
try it"
Browser Support
Internet Explorer 10, Firefox, Opera, Chrome, and Safari support formaction property.
Note: Internet Explorer 9 and earlier versions do not support IE formaction property.
Definition and Usage
formaction property overrides form element's action attribute.
This attribute type = "submit" used in conjunction.
Differences between HTML 4.01 and HTML5
formaction property is new in HTML 5 attributes.
grammar
<button type="submit" formaction=" URL ">
Property Value
值 | 描述 |
---|---|
URL | 规定将表单数据发送到的地址。 可能值:
|
HTML <button> tag