A form is a web page or part of a web page that allows the user to enter data using the familiar elements of a graphical user interface. Visible parts of a form include pop-up menu's, radio buttons, selection lists, etc. . The information entered into the form is then sent somewhere for processing, emailed somewhere, or reflected right back to the user.
The URL http://www.ucc.uconn.edu/~virtclas/formrefl.html points to a file that tells you what your form contained. NOTE:Formrefl.html only works with the GET method. More on this later.
The <FORM> tag has 3 attributes:
Attribute
Description
Default
ACTION
Where the forms contents will be submitted
The page the form resides on.
METHOD
The method used to submit the form - either GET or POST
GET
ENCTYPE
Specifies the type of encoding - There is only 1 possible value, and it only applies to the POST method.
application/x-www-form-urlencoded
The <INPUT>, <SELECT>, or<TEXTAREA> tags.
The easiest way to learn these tags is by example. Below you will find a sample forms elements side by side with the HTML that created it. Of course, the HTML snippets below must reside inside the <FORM></FORM> tag set.
Some definitions that make the examples easier to understand:
type
The type of "widget" you want to use - test,password,checkbox,radio,submit,reset.
name
The symbolic variable name associated with a widget.
value
The defualt text value of a widget, if applicable.
checked
Causes the checkbox or radio button to be selected by default.
size
The physical size of a text box.
maxlength
The maximum number of characters a text field will accept.