
click to enlarge
To see how this works, create a new HTML page in Dreamweaver or other Web design software. Create a form by clicking on “Insert,” “Form” and choosing “Form” from the pop up menu. Now place the cursor within the form—this is essential. Click “Insert” and “Form” again but then select “Fieldset” from the menu. This opens the Fieldset dialog box. In the “Legend” box, insert a descriptive name for the collection of input items. For this example, type “Contact Information.” If you decide to change the legend later, just edit it in the Document (Design) view. To see a more complex example, insert another Fieldset using the same process, but use “Computer Description” for the Legend. Once again, be certain the cursor is still within the form itself before inserting the additional Fieldset. Your form should look like the added image at this point.
If you preview this form in your browser, you will see how it looks to a user. At this point, the browser view shows the second Fieldset nested under the first, which you do not want. To correct this, click on the “Code” view tab. You will see the following code:
<form id="form1" name="form1" method="post" action="">
<fieldset>
<legend>Contact Information</legend>
<fieldset>
<legend>Computer Description</legend>
</fieldset>
</fieldset>
Delete the second “</Fieldset tag>” and then insert it at the end of the first Contact Information line so the code now appears as:
<form id="form1" name="form1" method="post" action="">
<fieldset>
<legend>Contact Information</legend></fieldset>
<fieldset>
<legend>Computer Description</legend>
</fieldset>
If you view the form now with a browser, the two Fieldsets will be in separate boxes but still within the form.