RuskFamily.com ... the Legend Continues Practice Page
| Home | HTML Guide Start | List of HTML Elements | Next Element | Previous Element |

<OPTION></OPTION>

Defines a choice to a SELECT element


Element used within a select portion of a form to provide a list of choices for the user.

	<html>
	<head>
	<title>A Simple Form</title>
	</head>
	<body>
	   .
	   .
	<form method="POST" enctype="text/plain" action="mailto:mike@ruskfamily.com">
	Your name please:<br>
	<input type=text name=name size=50 maxlength=50><br>
	How did you find me?:<br>
	<select name=howfound>
==>>	  <option selected value="Best Friend">Best Friend
==>>	  <option value="Close Friend">Close Friend
==>>	  <option value="Friend">Friend
==>>	  <option value="Larry King">Larry King
==>>	  <option value="Grease Man">Grease Man
==>>	  <option value="Told Not to Come">I was told not to visit
	</select><br>
	Comments?:<br>
	<textarea name=comment wrap=virtual rows=5 cols=55>I love this site because...</textarea>
	<br>
	<input type=submit value=Submit>
	<input type=reset value=Clear>
	</form>
	   .
	   .
	</body>
	</html>

So there it is! A simple guest book entry form that ends up mailing you the entry. Unless of course the viewer is using Microsoft Internet Explorer. Too bad.

If this example looks familiar it's because I'm using for all my form elements.

HTML 3.2 Final

The list of choices is fairly simple to set up:

value
What value is associated with the choice and will be passed back to you as the value of this field if it is selected. If you don't specify a value then you'll get back whatever text you put after the option element.
selected
Specify this for one of the options (or several if you're doing one of the multiple thingy's). This is known as the "default" choice if they don't do anything and just press SUBMIT.

Netscape

Nothing extra.

Microsoft Internet Explorer

Nothing special that I know of - yet.

Internationalization

Nothing special.

| Home | HTML Guide Start | List of HTML Elements | Next Element | Previous Element |

Michael T. Rusk
Comments to author: mike@ruskfamily.com

All contents copyright © 1996-2001 Michael T. Rusk
All rights reserved.

Valid HTML 4.01!   Valid CSS!

Revised: Sunday, December 30, 2007 11:06 -0500
URL: ./htmlgd/tagoptio.html