Favorite Ice Cream Survey
FORM example
Form tag has Action attribute whose attribute
value is the name of the CGI program that will execute on the
server when the form is submitted back to the server. We'll learn
about that later in the course, ignore it now. Method attribute also
has to do with CGI. Note that the form works the same in the browser
without the Action and Method attributes. Form must have a end Form
tag. Tags and Values are case-insensitive. In this page I show the
HTML that produces the Form and its various elements. I use uppercase
for tags and for required attributes, initial capital for optional
attributes. For attribute values that are numbers or predefined
meanings I don't double-quote them, but for attribute values of my own
creation I do quote them (quoting is only obligatory when including
spaces as part of a value).
<FORM Action="/cgi-bin/icecream_form.pl" Method=post>
This Action is at the same server this page came from.
Normally with a form you have an Action atribute which has the URL of
the CGI script that will be be run by the server when it gets the
form's submitted data. However, with this example form page we won't
have it submitted to a CGI script, so there won't be an Action.
A form can be submitted by email using the mailto Action:
<FORM Action="mailto:davidwills@hotmail.com" Method=post Enctype="text/plain">
The received email will be URL-encoded (i.e. messy looking).
If you don't want the form to be submitted to a CGI script you can
leave the Action and Method attributes out of the Form tag.
<FORM>
Clicking the Submit button then resets the form.