- Attribute of
- <input> HTML Tag
- What does
- Specifies a form to which the input field belongs.
<form id="form-demo"></form> <label for="name">Name</label><br> <input name="name" form="form-demo">
Fields outside the
The purpose of the
form attribute is to allow an
<input> field to be associated with a form without having to be contained within the the
<form> element. This may come in handy for complex web application layouts, but is not generally something you want to use in most standard form use-cases.
Not fully supported
Also, it is important to notice that this feature is not supported (as of this writing) in either of Microsoft’s browsers, Internet Explorer or Edge. As there is no “graceful fallback” here, and having form fields accidentally excluded from submission could cause serious problems, this feature is probably best avoided.
Browser Support for form
|Not supported.||43||45||Not supported.||9||34|