DIRECTORY
Main Menu
Affiliate Programs
Hosting
Traffic
Content
BillinG
Design
show pic archive
Articles
Tutorials
interviews
jbm newsletteRS
jbm JOBS BOARD
Contact Us
Message Board

Advertising inquiries


 
 
Tutorials - Creating a Drop-Down Box For Forms

I like these drop-down boxes for form work. I like to have all the items people can choose out in the open. The drop-down box, unless clicked on, only shows one item. But, this is your form and you can do anything you wish. Here's a drop-down. You have to click on it to see all the choices. This one is for people to choose their favorite color:

Here are the commands that placed the drop-down box on the page:

<SELECT NAME="Favorite_Color" SIZE="1">
<OPTION SELECTED>Blue
<OPTION>Red
<OPTION>Yellow
<OPTION>Green
<OPTION>Black
<OPTION>Orange
<OPTION>Purple
</SELECT>

Although this looks a little bit more involved, it really isn't. It's the same thing again and again. Here are the parts and what they mean:

* SELECT tells the computer another form is going here. This time it's a SELECT or drop-down form.

* NAME: Same as above. This is the heading of the form item. It denotes how the results of the reader will arrive at your e-mail box. In this case it will say; "Favorite_Color=" and then the reader's choice.

* SIZE denotes the size of the box. Here, 1 means one line or item is shown. Try putting two there if you'd like to see what it does. I prefer just one. More than one item tends to defeat the purpose of the drop-down box.

* OPTION SELECTED denotes which option will appear in the box. Note on the page that "Blue" is visible.

* OPTION denotes another choice that will be visible when you click on the item.

* /SELECT finishes off the entire deal.

I know already that some will ask if it's possible to make the drop-down box a series of links for people to choose and then go to. With HTML alone, it isn't possible. Using a Java Applet along with the code -- it is. In coming articles we will see how to incorporate the box into a larger form.

 

 

 

 

with help from htmlgoodies

Please pass on any suggestions or comments to Shok.