Result Size: 625 x 664
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The fieldset form attribute</h1>
<form action="/action_page.php" method="get" id="form1">
  <label for="favcolor">What is your favorite color?</label>
  <input type="text" id="favcolor" name="favcolor">
  <input type="submit">
</form>
<p>The fieldset below is outside the form, but still a part of the form.</p>
<fieldset form="form1">
  <legend>Personalia:</legend>
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname" form="form1"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname" form="form1">
</fieldset>
</body>
</html>