Example coding for the fieldset of radio buttons at the top of this page is shown below. You
should note that the <fieldset> tag expands the box
to the width of the page unless it is otherwise constrained. Therefore, you probably need
to place your grouped fields inside table cells or other container tags to control their placement
The legend can be styled with a style sheet; it can also be aligned to the left, center, or right
of its box with the align attribute. The following fieldset shows these
Users often move through the fields on a form with the tab key. The order in which the fields
are accessed is given, by default, by the physical order of coding on the XHTML form.
Normally, this is the sequence in which you want users to fill in your forms -- from top to bottom,
left to right.
You can, however, alter this tab order by using the tabindex
attribute within any control on your form. In the following form the text fields have been
indexed in reverse order. That is, you tab through the fields from bottom to top. Click in the first
field then use the tab key to proceed through the other fields to view this tab order.
Each field on a form is assign a tab order using tabindex
to assign a sequence number. You normally set the tabindex values to
1, 2, 3,...etc. from the first to last fields. A value of 0 causes the field to retain its physical
tab order; a negative value removes the field from the tab order completely.
The following listing shows the code for the text fields that you tabbed through above: