HTML <button> Tag with the 'formaction' Attribute
<form>
<!-- ...form contents... -->
<button type="submit" formaction="/resources/html-forms-action.cfm">
Submit
</button>
</form>
In the above example we add the formaction
attribute to a button control.
About the formaction
Attribute
The formaction
attribute allows you to specify the URL of the file that will process the control when submitted.
The W3C says:
The action of an element is the value of the element'sformaction
attribute, if the element is a submit button and has such an attribute, or the value of its form owner'saction
attribute, if it has one, or else the empty string.
About the <button>
Element
The <button>
element creates a button control in an HTML document.
Any contents of the <button>
element appears on the button.
The <button>
element can be associated with a form or stand alone by itself (in such case it could have JavaScript attached via the onclick
attribute) to make the button actually do something.