http://fishcaro.crosswinds.net/day_21_more_on_forms_nse.htm
In this lesson, we'll talk about the "ACTION" and "METHOD" attributes for the "FORM" tag; these attributes describe what action should be taken when the form is submitted, and what method should be used to send the information that is collected in the form. We'll also begin talking about the "INPUT" tag, which is the tag that is used to collect input.
INDEX CARD #21:
"METHOD" and "ACTION" ATTRIBUTES (21a)<FORM ACTION="URL_for_form_processing_program" METHOD=POST>
Note that <FORM> </FORM> is a container, and the stuff that goes inside the container describes what the form will look like.
The <FORM> tag takes two attributes to make it work:
--The ACTION
attribute asks: "When the form is submitted, what action should be taken?"
Its value is the URL of the CGI program that will process the information collected in the form. (Put the URL inside quotation marks.)
--The METHOD attribute asks: "What method should be used to send the
information to the form-processing program?" There are two possible
values: GET and POST . POST is the preferred transfer method, according
to the W3C. (When you write the form-processing program, it's
important to know whether you're using GET or POST . Don't worry about it right now.)
|
INTRODUCTION TO THE INPUT TAG (21b)<FORM> </FORM> container goes code that
specifies what the form should look like. The most common decision you need to
make when you're creating a form is: What type of input do you want? This is specified with the INPUT tag and its
TYPE attribute:
<INPUT TYPE="type_of_info" more attributes go here> --text, used for things like names names and addresses ( INPUT TYPE="text" )
--checkboxes, used for multiple-choice questions ( INPUT TYPE="checkbox" ).
Any number of items can be selected in checkboxes
(all, none, some).
--radio buttons, used to toggle between choices ( INPUT TYPE="radio" ).
Only one radio button in a group can be selected;
if no button is marked when the form is submitted, then the first button
is selected by default.
|
Printable version of Index Card 21a
Printable version of Index Card 21b
WORKSHEET #21:
ASSIGNMENT #21: