Select Object

By: aathishankaran Viewed: 153227 times  Printer Friendly Format    


The select object is one of the most useful and flexible of all the form objects. You can use it in- instances where you might otherwise use a- radio object. The select object can take up less real estate than a radio object, which needs space for each of its radio buttons. The basic HTML syntax for a select object follows:

 SYNTAX 

<SELECT [NAME="objectName"] [SIZE="numberVisible"] [MULTIPLE]

[onBlur="methodName"][onChange="methodName"][onFocus="methodName"]>

<OPTION VALUE="optionValue" [SELECTED]>displayText</OPTION> [<OPTION VALUE="optionValue">displayText</OPTION>] </SELECT> 

Example 

<Html>

<Head>

<Title>

Select Object Example

</Title>

<Body>

<Hl>Example for Select Object</Hl>

<H2>Select any item</H2>

<Hr>

 

<Form Name=form1>

<Center>

C 0 LOU R S

<Br>

<Select Name=sl Size=l onChange="tl.value=sl.value">

<Option Value=Red>Red

<Option Value=Blue>Blue

<Option Value=Green>Green

<Option Value=Yellow>Yellow

<Option Value=White>White

<Option Value=Pink>Pink

</Select>

<Br>

<Br>

<Input Type=Text Name=tl Size=20>

<Hr>

</Center>

</Form>

</Body>

</Html>

 Output

 



Most Viewed Articles (in JSP )

Latest Articles (in JSP)

Comment on this tutorial