University of Melbourne home page
 
Table of Contents

Grouping fields

Where a number of fields ask the user for related information, they should be grouped using the fieldset tag.

Sample

The construction brings together form tags covered individually elswhere.

<fieldset>
  <legend>Groups of fields</legend>
  <p>Where more than one input field forms a logical group of information, use a fieldset and legend to define the group.</p>
  <label for="q1">
    <span class="question">A text field:</span>
    <span class="answer"><input id="q1" type="text" name="q1" /></span>
  </label>
  <label for="q2">
    <span class="question">A text area:</span>
    <span class="answer"><textarea id="q2" name="q2" rows="5" cols="30" ></textarea></span>
  </label>
</fieldset>

Example

Groups of fields

Where more than one input field forms a logical group of information, use a fieldset and legend to define the group.

 
html/forms/library/nested_fieldsets.txt · Last modified: 2007/05/03 17:49 by aharris
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki