HTML Tutorial - Forms

Example HTML Tag Note
<input type="text" size=20 maxlength=80> Text Box
<input type="password" size=10 maxlength=20> Password Box
Gender?
Male Female
<input type="radio" name="gender" checked value="male">Male
<input type="radio" name="gender" value="female">Female
Radio Buttons
Menu:
Burger Fries Drink
<input type="checkbox" checked name="burger" value="yes">Burger
<input type="checkbox" name="fries" value="yes">Fries
<input type="checkbox" checked name="drink" value="yes">Drink
Check Boxes
Favorite Music:
<select name="music" size="1">
<option selected value="Coldplay">Coldplay</option>
<option value="Led Zeppelin">Led Zeppelin</option>
<option value="The Beatles">The Beatles</option>
</select>
Select Box
size=1 (choose 1 item)
size=3 (choose multiple items)
Comments:
<textarea wrap=virtual name="comments" cols=17 rows=5>Great website!</textarea> Textarea

<input type=submit name=submit value="Submit"> Submit Button

<input type=reset name=reset value="Reset Form"> Reset Button
<input type=hidden name=url value=page1> Hidden Form Field
Important Notes about HTML Forms
  • All the above fields must go between the opening and closing form tags.
  • OPENING FORM TAG: <form action="" method=post>
  • CLOSING FORM TAG: </form>
  • In the opening form tag you will see action="", inside the quotation marks you must put the location
    of the script to process the form. eg. http://www.yourserver.com/cgi-bin/form.cgi

  • HTML Tutorial     Home