left up right
Adding Structure to a Form

For long forms, structure can be added to parts of the form using the fieldset and legend elements. fieldset groups a set of inputs and legend gives them a title. For example:

<fieldset style="background-color:lemonchiffon;border:solid 4pt">
<legend style="font-style:italic;color:green">Personal Details</legend>
<p style="margin:10pt">Name: 
<input name ="NAME" type="text" size="40"  maxlength="40" /></p>
<p style="margin:10pt">Email: 
<input name ="EMAIL" type="text" size="40" maxlength="40" /></p>
</fieldset>

<fieldset  style="background-color:pink;border:solid 3pt">
<legend style="font-style:italic;color:green">Musical Interests</legend>
<p style="margin:10pt">Indicate your choice of music:</p>
<p style="margin:10pt">Jazz: 
<input id="jz1" type ="radio" name="music" value="jazz" checked="checked" />
Classical:
<input id="cl1" type ="radio" name="music" value="classical" />
Folk or World: 
<input id="fl1" type ="radio" name="music" value="folk" /></p>
<p style="margin:10pt">Indicate why you like this music</p>
<p style="margin:10pt">
<textarea name="para" rows="7" cols="60" >My reasons:</textarea>
</p></fieldset>