HTML and buttons and formaction properties
When you use the formaction property, the form's submission address uses the value of the property itself, not the value of the action property of the label, refer to the following example:
Form with two submit buttons (with different actions), the first submit button to submit the form data to demo_form.html, and the second submit button to submit the form data to demo_admin.html:
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 out . . .
Browser support
Internet Explorer 10, Firefox, Opera, Chrome, and Safari support formaction properties.
Note: Formaction properties are not supported by Internet Explorer 9 and earlier versions of IE.
Definitions and usages
The formaction property overrides the action property of the form element.
This property is used in conjunction with type "submit".
The difference between HTML 4.01 and HTML5
The formaction property is a new property in HTML 5.
Grammar
The property value
value | describe |
---|---|
URL |
Specifies the address sent to the form data.
Possible value:
|
HTML slt;button-and-label