HTML <textarea> form ominaisuus

Määrittely ja käyttö

form Ominaisuus määrittää tekstialueen kuuluvan lomakkeen.

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

Text area 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 attribute 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 attribute.

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