Attributo del modulo HTML <pulsante>

❮ Tag HTML <pulsante>

Esempio

Un pulsante situato all'esterno di un modulo (ma fa ancora parte del modulo):

<form action="/action_page.php" method="get" id="form1">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname">
</form>

<button type="submit" form="form1" value="Submit">Submit</button>

Definizione e utilizzo

L' formattributo specifica il modulo a cui appartiene il pulsante.

Il valore di questo attributo deve essere uguale idall'attributo di un <form> elemento nello stesso documento.


Supporto browser

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

Attribute
form 10.0 16.0 4.0 5.1 9.5

Sintassi

<button form="form_id">

Valori di attributo

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

❮ Tag HTML <pulsante>