Atributo de formulario HTML <entrada>
Ejemplo
Un campo de entrada ubicado fuera del formulario HTML (pero que sigue siendo parte del formulario):
<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">
Definición y uso
El form
atributo especifica la forma a la
<input>
que pertenece el elemento.
Compatibilidad con navegador
Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con el atributo.
Attribute | |||||
---|---|---|---|---|---|
form | Yes | Yes | Yes | 5.1 | 10.6 |
Sintaxis
<input form="form_id">
Valores de atributos
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. |
❮ Etiqueta HTML <entrada>