HTML <select> formAttribute
Example
A dropdown list located outside the form (but still part of the form):
<form action="demo_form.html" id="carform">
Firstname:<input type="text" name="fname">
<input type="submit">
</form>
<select name="carlist" form="carform">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
Firstname:<input type="text" name="fname">
<input type="submit">
</form>
<select name="carlist" form="carform">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Firefox, Opera, Chrome, and Safari support the form attribute.
Note:Internet Explorer does not support the form attribute of the <select> tag.
Definition and Usage
The form attribute specifies one or more forms to which the dropdown list belongs.
Differences between HTML 4.01 and HTML5
The form attribute is a new attribute in HTML5.
Syntax
<select form="form_id">
Attribute Values
| Value | Description |
|---|---|
| form_id | Specifies a space-separated list of ids of one or more forms to which the dropdown list belongs. |
HTML <select> Tag Other Extensions