HTML Form Ownership and Submitter Overrides
Associate an external control
A form-associated control such as input or button can use form="id" to identify its owner in the same document even when it is outside the form. The target must be an actual form element.
<form id="order"> <label> Item <input name="item" value="Book"> </label></form><label> Note <input form="order" name="note" value="Gift"></label>The outside note belongs to order and is included in its entries.
Override settings per submitter
A submit button can override action, method, encoding, target and interactive validation with formaction, formmethod, formenctype, formtarget and formnovalidate. The form below uses an event listener (JavaScript preview) to prevent navigation and display the selected submitter value.
<form id="editor" action="/save" method="post"> <label> Title <input name="title" value="Draft"> </label> <button type="submit" name="intent" value="save">Save</button> <button type="submit" name="intent" value="preview" formaction="/preview" formmethod="get">Preview</button></form><output id="result"></output><script> const f=document.getElementById("editor"); f.addEventListener("submit", event => { event.preventDefault(); document.getElementById("result").textContent=event.submitter.value; });</script>Click Preview to display preview locally; no request is sent.
Skip interactive validation for a draft
formnovalidate lets a particular submitter skip interactive validation, for example saving an incomplete draft. requestSubmit() behaves like activating a submit button; submit() bypasses validation and the submit event, so do not use it to replace normal validated submission.
<form id="draft"> <label> Title <input required name="title"> </label> <button type="submit" formnovalidate>Save draft</button></form><output id="result"></output><script> const f=document.getElementById("draft"); f.addEventListener("submit", event => {event.preventDefault();document.getElementById("result").textContent="Draft event";});</script>The draft button fires submit despite the empty title; the listener prevents sending.
Common mistakes and practice
form on a fieldset does not automatically associate all descendants. Use unique IDs and explicit form attributes where needed. Only the activated named submitter normally contributes its own value. Server policy still decides whether incomplete drafts are acceptable.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML Form Ownership and Submitter Overrides — Knowledge Check
Apply the control concepts taught in this lesson.
How does an outside input identify its owner?
Which attribute overrides the destination for a submit button?
Which attribute skips interactive validation for one submitter?
Which API behaves like normal submitter activation?
Which named submit button value normally enters the submission?