HTML form Attribute Demo







These controls are outside the <form>...</form> element but are associated with it through the form='f1' attribute, where f1 is the form ID.

HTML

<form method="post" action="" id="f1">
  <button type="submit">Submit</button>
</form>

<label for="textArea1">Textarea linked to form f1</label>
<textarea id="textArea1" name="textArea1" rows="3" cols="50" required form="f1"></textarea>

<label for="t1">Text input linked to form f1</label>
<input id="t1" type="text" name="t1" form="f1" required>