HTML Tutorials
HTML Forms
HTML Basics

HTML Forms

Basic Syntax

Form Header

<FORM METHOD="GET" ACTION="next.html">

This line starts the form. The METHOD part of the tag determines how the form information gets passed back to the web server. Using GET will append it to the end of the URL for example listing all input with values separated by a &. If you want to hide the information entered set METHOD to POST. The ACTION statement tells the browser where to go upon submitting the form. This line doesn't display anything to the screen.

Simple Text Boxes

These are the basic input boxes. This is determined by the TYPE="text" . The NAME="City" represents the variable name to give the field. SIZE="40" sets the length of the textbox.. You see an example of the MAXLENGTH setting down below it sets the maximum allowable length of input. By setting the type as password the input text is displayed as * for protection.

Name: <INPUT TYPE="text" NAME="name">
Password: <INPUT TYPE="password" NAME="pass">
Address: <INPUT TYPE="text" NAME="address" SIZE="40">
City <INPUT TYPE="text" NAME="City">
Zip code:
Zip code: <INPUT TYPE="text" NAME="zip" SIZE="7" MAXLENGTH="5">

Textarea multiline text boxes

The <TEXTAREA> tag is another method of raw input. TEXTAREA starts a textbox. Unlike INPUT tags which use the SIZE flag to determine size text areas use ROWS and COLS to set the size. You can also set a WRAP setting in the EXTAREA tag. The settings are off which doesn't include word wrap soft which enables word wrap in the field but doesn't place linebreaks in the input and hard which wraps in the text box and inserts linebreaks in the data. Textarea fields are closed with a </TEXTAREA>.

Tell us about yourself:
Introduction <<  1 2 3 4  >> Structured Form Input
New Content