Web Page Design Boot Camp

  Home |  Basics |  Intermediate |  Advanced |  Tools |  Site Map    Subtopics:

Text Entry

Text Box

The text box is the most common form control. It allows for entry of short strings of text, such as a name, street address, or a description. Internet search engines use text boxes to collect your search criteria and you use them at onlne commerce sites like Amazon.com to specify the subject, title, or author of books you're interested in. The basic format of the text box control is:

This HTML... Produces this...
<form>
<b>Description:</b>
<input type=text name="stuff" size="5" 
value="xyz">
</form>
	
Description:
The name property is required. The optional size property specifies the number of characters to be displayed in the text box but does not limit the number that can be entered. The optional value property specifies the inital value displayed in the text box when the web page is first displayed.

Text Area

The text area control allows for larger amounts of text, such as a paragraph or more. Web-based email services like Yahoo Mail use the text area control on the pages their customers use to compose messages. Here is an example.

This HTML... Produces this...
<form>
<textarea name="description" rows="5"
cols="30">
Your default text goes here.
</textarea>
</form>
The rows and cols properties, which are required, specify the number of rows and columns to be displayed in the text area. If the amount of text grows beyond the space allotted, a scroll bar will be added.