form-fieldset.mdx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. title: Form fieldset
  3. description: By grouping form elements together with the fieldset element, you can improve the organization and accessibility of your forms, making it easier for users to understand the purpose of each input and provide accurate information.
  4. ---
  5. ## Default markup
  6. Group parts of your form to make it well-structured and clearer for users, using the `fieldset` element.
  7. ```html example centered columns="1" height="30rem"
  8. <fieldset class="form-fieldset">
  9. <div class="mb-3">
  10. <label class="form-label required">Full name</label>
  11. <input type="text" class="form-control" autocomplete="off" />
  12. </div>
  13. <div class="mb-3">
  14. <label class="form-label required">Company</label>
  15. <input type="text" class="form-control" autocomplete="off" />
  16. </div>
  17. <div class="mb-3">
  18. <label class="form-label required">Email</label>
  19. <input type="email" class="form-control" autocomplete="off" />
  20. </div>
  21. <div class="mb-3">
  22. <label class="form-label">Phone number</label>
  23. <input type="tel" class="form-control" autocomplete="off" />
  24. </div>
  25. <label class="form-check">
  26. <input type="checkbox" class="form-check-input" />
  27. <span class="form-check-label required">I agree to the Terms & Conditions</span>
  28. </label>
  29. </fieldset>
  30. ```
  31. ```html
  32. <fieldset class="form-fieldset">
  33. ...
  34. <div class="mb-3">
  35. <label class="form-label required">Company</label>
  36. <input type="text" class="form-control" autocomplete="off"/>
  37. </div>
  38. ...
  39. </fieldset>
  40. ```