Free Web space and hosting from freehomepage.com
Search the Web


HOME
BASIC TUTORIAL
What is Html?
Sample Web Page
Basic Tags
Character Entities
Html Links
Frames
Tables
Lists
Forms
Images
Backgrounds
APPENDIX
Html Tag List

Forms and Input

An html form is used to select a kind of user input. A form is an area that can contain form elements. These elements allow the user to enter information in a form. The <form> tag defines a form.
The
input is the most commonly used form tag. The type of input is selected by the attribute. The most commonly used ones are defined below.

TEXT FIELDS

Text fields are used when you want the user to type in something on a form.
<form>
First Name:
<input type=”text” name=”firstname”>
<br>
Last Name:
<input type=”text” name=”lastname”>
</form>

RADIO BUTTONS

Radio buttons are used when you want the user to select one of a limited number of choices.
<form>
<input type=”radio” name=”gender” value=”male”> Male
<br>
<input type=”radio” name=”gender” value=”female”> Female
</form>

CHECKBOXES

You should use a checkbox when you want the user to select one or more of a limited number of choices.
<form>
<input type=”checkbox” name=”bike”> I have a bike
<br>
<input type=”checkbox” name=”car”> I have a car
</form>

SUBMIT BUTTONS

To create a “Submit” button, use an action attribute. When the user clicks on the button, the contents of the form are sent to another file. The form’s action attribute defines the name of the file, and the defined file usually does something with the input.
<form name=”input” action=”submit.htm” method=”get”>
Username:
<input type=”text” name=”user”>
<input type=”submit” value=”submit”>
</form>

To see what some forms would look like, click
here.
To learn how to create html images, click “next”.

Much of what I learned to create this tutorial I found on www.w3schools.com.
Back to Top
Lewisville Middle School-2003