The HTML Form Elements

The following is a list of all form elements that may be used in an HTML page.
Text Field
Text fields are one line areas that allow the user to input text.

<input type="text" name="lastName" size="25" value="Enter your name here!" />

Password Field
Password fields are similar to text fields. The difference is that what is entered into a password field shows up as dots on the screen. This is, of course, to prevent others from reading the password on the screen.

<input type="password" name="pass" size="25" value="Enter your password here!" />

Hidden Field
The hidden field does not show on the page. Therefore the visitor can’t type anything into a hidden field, which leads to the purpose of the field to submit information that is not entered by the visitor.

<input type="hidden" name="Language" value="English" />

Check Box
Check boxes are used when you want to let the visitor select one or more options from a set of alternatives.

<input type="checkbox" name="option1" value="Milk" /> Milk
<input type="checkbox" name="option2" value="Butter" checked /> Butter
<input type="checkbox" name="option3" value="Cheese" /> Cheese

Radio Button
Radio buttons are used when you want to let the visitor select one – and just one – option from a set of alternatives.

<input type="radio" name="group1" value="Milk" /> Milk
<input type="radio" name="group1" value="Butter" checked /> Butter
<input type="radio" name="group1" value="Cheese" /> Cheese
<hr />
<input type="radio" name="group2" value="Water" /> Water
<input type="radio" name="group2" value="Beer" /> Beer
<input type="radio" name="group2" value="Wine" checked /> Wine

Drop-down Menu
Drop-down menus can serve the same purpose as radio buttons (one selection only) or check boxes (multiple selections allowed). The advantage of a drop-down menu, compared to radio buttons or check boxes, is that it takes up less space. But that is also a disadvantage, because people can’t see all options in the menu right away.

<select name="mydropdown"/>
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select>

Text Area
Text areas are text fields that can span several lines.

<textarea cols="40" rows="5" name="myname"></textarea>