session 11 - FORMS

 A form is a graphical user interface with text entry fields and areas, buttons, checkboxes, pull-down menus, scrolling lists, etc. When you write a form, each of your input items has a NAME tag. When the user places data in these items in the form, that information is encoded into the form data. When a user presses a button indicating the form should be "submitted," the information in the form is normally sent to a server for processing via a CGI program. However, if you don't have CGI capability or you simply want to have the data emailed to you, you may use the <mailto action. Begin a form using the following line:<FORM METHOD="POST" ACTION="mailto:your email address"> METHOD=POST>

This line says that a new form is starting, it is going to POST the information from the form, and that the ACTION it's performing is mailing to the specified email address.
Entering Text
The text box is the most basic form element. It produces the box you see below. To create a text box in your form use this line:
<INPUT TYPE="text" NAME="name" SIZE="30">
Note the parts of this form element. TYPE specified that this is a text input line. NAME is the name that will be used when the ACTION occurs. The SIZE specifies its width in characters. The other type of text form element is the text area. It produces the larger box you see below, but can be any size. To create a text area use this:<TEXTAREA NAME="name" ROWS=6 COLS=40></TEXTAREA>If you want to display any instructions inside the element, enter them inside the TEXTAREA opening and closing tags. Text placed between these tags sets the element's initial value and will be submitted with the form unless your visitor deletes it.

The ROWS and COLS specify the width and height of the area in characters.

The Radio Button

A radio button allows you to give a user a group of choices and allow them to select only one. A group of radio buttons is shown below. To create a radio button use this line:<INPUT TYPE="radio" NAME="heading of button" VALUE="button name"> button name. In order to have multiple buttons connected to each other in a set, they will all have the same NAME.

The Check Box

A checkbox is just like a radio button except that you can select as many of the options as you'd like. To create a checkbox use this:<INPUT TYPE="checkbox" NAME="checkbox name" VALUE="name of option"> name of option

Drop-Down Lists

Using this line creates a drop-down box that allows you to choosecolor:

<SELECT NAME="name" SIZE="1">
<OPTION SELECTED>Blue
<OPTION>Red
<OPTION>Yellow
</SELECT>
 

INDEX

NEXT PAGE

Music 
News
Health
 History
  Sports
Archaeology
Geography
 College Courses