HTML <textarea> form Attribute

Definition and Usage

form The attribute specifies the form to which the text area belongs.

The value of this attribute must be equal to the id attribute of the <form> element in the same document. <form> The id attribute of the element.

Example

A textarea outside the form (but still part of the form):

<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>

Try It Yourself

Syntax

<textarea form="form_id">

Attribute Value

Value Description
form_id

Specifies the form element to which the <textarea> element belongs.

The value of this property must be the id attribute of the <form> element in the same document.

Browser Support

The numbers in the table indicate the first browser version to fully support this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 11.0 Support Support Support