HTML <select> formAttribute

HTML select 标签参考手册 HTML5 <select> tag

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>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 标签参考手册HTML <select> Tag Other Extensions