Along with the <form> tag, two more arguments are also included to specify to the browser what exactly to do with this form. For now, we will discuss these arguments, but we will see what they do later in the tutorial.
Each of these different representations of input has it's own argument to the input tag. Through the utilization of the TYPE argument to the Input tag, a web author can specify how exactly he/she would like the user to input the data into the form...
This is the heart of form development. The <INPUT...> tag determines how the data is going to get inputted into your file, new document, or even your mailbox. Throughout the rest of this document, we will focus mostly on the types of input mechanisms used in form creation in your webpages.
Choose your favorite Music Group
(note that the size determines the look of the selection box)
(Size smaller than number of elements) <SELECT NAME="musicgroup" SIZE=3 ALIGN=LEFT> |
(Exact Size) <SELECT NAME="musicgroup" SIZE=4 ALIGN=LEFT> |
(Size of 1) <SELECT NAME="musicgroup" SIZE=1 ALIGN=LEFT> |
The Check Box is created like so:
<INPUT NAME="check1" TYPE="CHECKBOX" VALUE="choice 1">I'll choose choice 1<BR>
<INPUT NAME="check2" TYPE="CHECKBOX" VALUE="choice 2">I'll choose choice 2<BR>
With a Check box, and its yes/no property, a user has the option of choosing as many as he/she wishes. (When Found in a group, each box is handled as a separate case)
<INPUT NAME="radio1" TYPE="RADIO" ALIGN=LEFT VALUE="1"> choice 1
<INPUT NAME="radio1" TYPE="RADIO" ALIGN=LEFT VALUE="2"> choice 2
<INPUT NAME="radio1" TYPE="RADIO" ALIGN=LEFT VALUE="3"> choice 3
<INPUT NAME="radio1" TYPE="RADIO" ALIGN=LEFT VALUE="4" CHECKED> choice 4
<INPUT NAME="radio1" TYPE="RADIO" ALIGN=LEFT VALUE="5"> choice 5
<INPUT NAME="radio1" TYPE="RADIO" ALIGN=LEFT VALUE="6"> choice 6
<TEXTAREA NAME="comments" ROWS=5 COLS=40 ALIGN=LEFT></TEXTAREA><BR>
The TEXTAREA tag contains a few fields of its own. The ROWS and COLS attributes define obviously how many rows or columns will be displayed respectively. The TEXTAREA tag is unique in that it is the only one of the HTML Form tags that requires an ending tag. This is because the author of the page can set default text within the Memo Field by placing it between the begining and ending tags. Here's a small example of default text settings:
<TEXTAREA NAME="comments" ROWS=2 COLS=25 ALIGN=LEFT>
This is Default Text</TEXTAREA><BR>
A Reset button is constructed much like a submit button. A reset button will clear all form data entered in the form at the present time. This is useful if the user decided to change his/her answers, found an error in inputting data, or just decided to clear the input. Let's take a look at the Reset Button:
This concludes my tutorial on Forms in HTML. Now we're ready to learn how to deal with the information that has been submitted. (where it goes, how to break it up, what to do with it...)