 | Tool for displaying and managing data. |
 | Used for both client and server applications. |
 | Form tag (<form>) contains one or more elements making up the form.
Multiple forms can exist in a document. |
 | Key attributes for the form tag:
 | action - file name, URL, or script to be run |
 | method - POST (sends form data to server via data stream) or
GET (appends data to URL: www.acme.com/cgi-bin/progname?productid=123456).
GET is best for small forms, POST for larger forms and to hide data.
GET is also useful for dynamically constructed URLs with information. |
 | name - object name for the form |
 | enctype - encoding instructions for the form data
(default is "application/x-www-form-urlencoded" - sets spaces
to + and nonalpha characters to %, line breaks to %0D%0A). |
|
 | mailto: is a popular way to submit form information via a browser/mail
function (does not work if mail is not set up in a browser). |
 | Form input elements:
 | button - interactive button (major use is in client applications)
|
 | submit - used to send form data to the action designation. |
 | reset - restores form to original state (not necessarily a clear
function). |
 | checkbox - binary selection |
 | file - send files to the browser (user must select file) |
 | hidden - good for hiding data |
 | image - can be used as a submit object |
 | password - variation of a text box, hides content |
 | radio - group buttons (all buttons with the same name work
together) |
 | text - single line text entry box |
 | select - drop-down and list, use option items for each entry
(size="1" causes single line drop down box; size > 1 creates list box). |
 | textarea - multiline text box |
|
 | User issues:
 | Make forms explanation intensive, never assume anything about how data
is entered. |
 | Tables are a great way to structure a forms appearance. |
 | Make form/input element names meaningful (will help you with
client/server apps). |
|
CGI = Common Gateway Interface - the protocol that defines how servers
interact with other programs on the server. Key functions include:
 | Ability to get information submitted via a browser form (i.e., the program
can get data submitted via the form, e.g., fields). |
 | Ability to transmit HTML output. |
 | Ability to access server specific data (e.g., name of server, URL specific
information). |
 | Ability to track information between sessions (i.e., pages served). |
 | Ability to call/run/terminate (politely) applications. |
|