Quick link to menu (Bottom of page)

Learn-A-Little HTML

Text Box

A text box is used to hold a single line of text.  They can be used for registration forms or any type of form where short responses are needed.

A text box is place inside the form area of the HTML document.  The format used is:

<INPUT TYPE="text" NAME="title" SIZE="n" MAXLENGTH="n">

where the "title" is a word that identifies the contents of the text box.  SIZE="n" is optional, and specifies the width of the text box, with "n" being the width of the box in characters.  MAXLENGTH="n" is also optional, and specifies the maximum number of characters that can be typed in the box.

An example using text boxes is:

Name:  <input type="text" name="username" size="30"><br>

Address:  <input type="text" name="address" size="30"><br>

City:  <input type="text" name="city" size="15"><br>

State: <input type="text" name="state" size="5" maxlength="2"><br>

Zip:  <input type="text" name="zip" size="5">

In a browser, it looks like:

Name:  
Address: 
City:   State:  Zip: 

Using tables to line the columns up would give us a neater looking form.  Now you try:

 


Okay, now let's try some checkboxes.

BackNext Page

Menu:


Take me back to the top.