HTML form code – HTML Forms part 3

HTML form code – HTML Forms part 3 cover image
  1. Home
  2. HTML
  3. HTML form code – HTML Forms part 3

<SELECT>… </SELECT> form element

This HTML form element lets you develop a drop down scrolling list or menu. The list can allow for single as well as multiple selections.

The individual items of the list are placed with the help of another tag, <OPTION> (described below).

The attributes taken are:

Here is how you create a four-item drop down selection list.

Which system do you use? 
<SELECT NAME="platform" SIZE="1">
<OPTION VALUE="win">Windows
<OPTION VALUE="mac">Macintosh
<OPTION VALUE="unix">Unix
<OPTION VALUE="oth">Other
</SELECT>

Which system do you use?

<OPTION> </OPTION>

The <OPTION> tag defines an item of the selection list described above. Its end tag is not required. It takes two attributes:

Which system do you use? 
<SELECT NAME="platform" SIZE="1">
<OPTION VALUE="win">Windows
<OPTION VALUE="mac">Macintosh
<OPTION VALUE="unix" SELECTED>Unix
<OPTION VALUE="oth">Other
</SELECT>

Which system do you use?

HTML form TEXTAREA elements

This creates a multi-line text box. Its attributes are:

To define a value for the TEXTAREA, include the text between the start and end tags.

<TEXTAREA NAME="query" COLS="20" ROWS="5">
Please type your query here.
</TEXTAREA>

<BUTTON>…</BUTTON>

This element is specific to Internet Explorer and ignored by Netscape.
It creates a button that is quite similar to ones made by <INPUT TYPE=”BUTTON”>. It takes the following attributes:

<BUTTON NAME="somebut" TYPE="BUTTON" VALUE="justabut">
Just for Kicks</BUTTON>

Note: The text that is placed between the closing and ending tags is displayed on the button.

What do you do now?
As mentioned previously, forms are pretty useless if you don’t know client-side or server side scripting. In order to gain full advantage of forms, you should learn a client-side and a server-side language.

HTML