How to write FIELDSET element

HTML allows web designers to create structure in a form. The FIELDSET element allows web designers to access the related content and sub controls with a structure. With the help of this a web designer can divide the form into multiple sub-parts while working with many form controls.

The FIELDSET element is helpful for user who navigate through the Tab key. This element can create the web document more accessible for user who are visually-impaired and are using aural software such as screen reader. When a user presses the Tab key, the control will receive focus depending on the order specified by the tab index attribute. It also contains the LEGEND element that assigns a caption to a group of controls.

 

 

<!DOCTYPE HTML PUBLIC>

<HTML>

<HEAD>

<TITLE> Shopping Centre </TITLE>

</HEAD>

<BODY>

<FORM method=”POST” action=”Example.asp”>

<FIELDSET>

<LEGEND>Contact detail</LEGEND>

<Table>

<TR>

<TD>Enter Name : </TD>

<TD> <input type=”text”/> </TD>

</TR>

<TR>

<TD> Occupation: </TD>

<TD><input type=”text”/></TD>

</TR>

<TR>

<TD> Telephone : </TD>

<TD> <input type=”text”/> </TD>

</TR>

</Table>

</FIELDSET>

<LEGEND> Delivery Address </LEGEND>

<Table>

<TR>

<TD> Pin code: </TD>

<TD> <input type=”text”/> </TD>

</TR>

<TR>

<TD> Country : </TD>

<TD> <input type=”text”/> </TD>

</TR>

</Table>

</FIELDSET>

<Input type=”Submit” /> &nbsp;

<input type=”Reset” value=”Reset”/>

 

</FORM>

</BODY>

</HTML>

 

Two sections are created in a form by using the FIELDSET elements. In the Above first section FIELDSET allows all the fields and the second section accepts the input address.

output