Atributo de formulario HTML <textarea>

❮ Etiqueta HTML <área de texto>

Ejemplo

Un área de texto ubicada fuera de un formulario (pero que sigue siendo parte del formulario):

<form action="/action_page.php" id="usrform">
  Name: <input type="text" name="usrname">
  <input type="submit">
</form>

<textarea name="comment" form="usrform">Enter text here...</textarea>

Definición y uso

El formatributo especifica el formulario al que pertenece el área de texto.

El valor de este atributo debe ser igual al idatributo de un <form> elemento en el mismo documento.


Compatibilidad con navegador

Attribute
form Yes 11.0 Yes Yes Yes

Sintaxis

<textarea form="form_id">

Valores de atributos

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

❮ Etiqueta HTML <área de texto>