English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML select form Attribut

Die form-Attribut spezifiziert ein oder mehrere Formulare, zu denen die Dropdown-Liste gehört.

HTML5 <select> Tag

Online-Beispiel

Eine Dropdown-Liste außerhalb des Formulars (aber dennoch Teil des Formulars):

<form action="action_page.php" id="carform">
  Firstname:<input type="text" name="fname">
  <input type="submit">
</form>
<br>
<select name="carlist" form="carform">
  <option value="PHP">PHP</option>
  <option value="Python">Python</option>
  <option value="C#">C#</option>
  <option value="Golang">Golang</option>
</select>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

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 that the dropdown list belongs to.

HTML 4.01 and HTML5differences between

The form attribute in HTML5 New attribute added in.

Syntax

        <select form="form_id"

Attribute Value

ValueDescription
form_idSpecify the form element that the <select> element belongs to. The value of this attribute must be the id attribute of a <form> element in the same document.
 HTML <select> Tag