
How list box values can be accessed in the form processing
script? |
The <SELECT> tag has two properties that we will discuss: the NAME property and the SIZE PROPERTY. The name property serves the same purpose as with the text box form field type it uniquely identifies the particular list box. The SIZE property determines how many list options are shown at one time. The default value for the SIZE PROPERTY is 1, which means that a list box, by default, will show only one option at a time. Display a list box with the default SIZE PROPERTY AND A LIST BOX WITH A SIZE property.
The <OPTION> tag has two important properties. The first is the value property, which uniquely identifies each separate list box option. When the user selects a list box option and submits the form, the form processing script is passed the string in the value property of the selected list box item. The value property does not determine what is displayed in the list box. Examine the code in listing. This is the code that, when viewed through a browser.
Understanding the <OPTION> Tag
1:
<HTML>
_______________________________________________________________________
FREE
Subscription
Subscribe to our mailing list and receive new articles Note
: We never rent, trade, or sell my email lists to Visit
.NET Programming Tutorial Homepage ______________________________________________________ Recommended
Resource
2: <BODY>
3: <FORM METHOD=GET ACTION = /Scripts/Somefile.asp>
4:
This list box has its SIZE Property set to the default
5: <BR>
6:
<SELECT NAME = ASPOption>
7: <OPTION VALUE=5> i like
ASP a lot! </OPTION>
8: <OPTION VALUE = 4>asp SURE
IS NEAT. </OPTION>
9: <OPTION VALUE= 3 > its
Interesting </OPTION>
10: <OPTION VALUE = 2 >ASP is
difficult! </OPTION>
11: <OPTION VALUE= 1>Ah! </OPTION>
12:
</select>
13: <P>
14: This list box has its SIZE property set
to 5:
15: <BR>
16: <SELECT NAME = Experiences SIZE = 5>
17:
<OPTION VALUE = 10 > 10 YEARS OF asp Experience </OPTION>
18:
<OPTION VALUE = 9 > 9 YEARS OF asp Experience </OPTION>
19:
<OPTION VALUE = 8 > 8 YEARS OF asp Experience </OPTION>
20:
<OPTION VALUE = 7 > 7 YEARS OF asp Experience </OPTION>
21:
<OPTION VALUE = 6 > 6 YEARS OF asp Experience </OPTION>
22:
<OPTION VALUE = 5 > 5 YEARS OF asp Experience </OPTION>
23:
<OPTION VALUE = 4 > 4 YEARS OF asp Experience </OPTION>
24:
<OPTION VALUE = 3 > 3 YEARS OF asp Experience </OPTION>
25:
<OPTION VALUE = 2 > 2 YEARS OF asp Experience </OPTION>
26:
<OPTION VALUE = 1 > 1 YEARS OF asp Experience </OPTION>
27:
<OPTION VALUE = 0 > Less than a year of asp Experience </OPTION>
28:
</SELECT>
29: </BODY >
30: </HTML>
through email. Keep yourself updated with latest
developments in the industry.
anyone.
We assure that your privacy is respected
and protected.