:: code war·ri·or                    
                   

Selections & Buttons

Drop Down Boxes

These let your visitor choose from a range of options in a list (like radio buttons). You'll need to use two tags to create this control - the SELECT tag for the whole list, and an OPTION tag for each item in the list.

As usual, it makes more sense when you see it.

<SELECT NAME="COLOUR">
<OPTION VALUE="Red">Red
<OPTION VALUE="Yellow">Yellow
<OPTION VALUE="Blue" SELECTED>Blue
<OPTION VALUE="Green">Green
<OPTION VALUE="Purple">Purple
</SELECT>

The field name is set with the NAME attribute in the SELECT tag. You can specify a default value with the SELECTED attribute of the OPTION tag, and the VALUE attribute is what is returned if that option is chosen.

Send and Clear Buttons

The final item that your form needs is a submit button - this is what sends all the information to your form handler (probably a CGI script).

<INPUT TYPE="SUBMIT" VALUE="Send Form">

Use the value attribute to control what text should appear on the button.

You can also have a reset button that will clear all the data from the form:

<INPUT TYPE="RESET" VALUE="Reset">

 

Submitting with an Image

If you want to use an image as a submit button, you can. Just use the following code, making sure that the SRC attribute points to the image file:

<INPUT TYPE="IMAGE" SRC="submit.gif" onClick="form.submit">

You can see below I have used an image for my search submit button.


· code-warrior
· HTML Tutorials
· Forms


Quick Links
· Form Basics
· Text Fields
· Input Fields
· Selections & Buttons



SHOP
· Books @ Amazon
· Software @ Amazon

Please send any comments to
This HTML guide is a free resource
© Code Warrior 2002

  

:: made on a mac