Attributo del modulo HTML <input>

❮ Tag HTML <input>

Esempio

Un campo di input situato all'esterno del modulo HTML (ma fa ancora parte del modulo):

<form action="/action_page.php" id="form1">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <input type="submit" value="Submit">
</form>

<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname" form="form1">

Definizione e utilizzo

L' formattributo specifica la forma a cui <input>appartiene l'elemento.


Supporto browser

I numeri nella tabella specificano la prima versione del browser che supporta completamente l'attributo.

Attribute
form Yes Yes Yes 5.1 10.6

Sintassi

<input form="form_id">

Valori di attributo

Value Description
form_id Specifies the form element the <input> element belongs to. The value of this attribute must be the id attribute of a <form> element in the same document.

❮ Tag HTML <input>