FORMS (Chapter 10 and Chapter 12)
Forms & Form Processing.
Form - a tool for collecting and delivering data from the user.
Forms and form types are what we will cover. Form processing and CGI scripts we will not.
Tags
<form> </form>
Two NECESSARY attributes action & method
action="mailto:bonidie@pitt.edu"
- action points to the application that will process the data captured by the form.
method="post"
-can equal "get" or "post"
- method tells the browser how to send the data to the server.
- "mailto:" always requires "post"
input tag - creates an input element (control) within a form
<input />
important attributes: name, value, type
name - required by most input controls
type - defines which input control you will provide to the user.
value - assign a default value to the field.
control types -
button - control that has no predefined funtion
text - allows the user to submit typed text.
checkbox - allows for multiple selections in a series.
file - sending an entire file
radio - button that ensures only one selection is made
submit - activates the coding as submission process of the browser or invokes the associated a-mail application.
reset - clear selections
Drop Down list boxes
Select tag - creates a list box made up of enclosed elements.
Note: If you want to have multiple selections use the keywords "select multiple" such as in the following example:attributes: name, size, style, multiple
*must contain at least one <option> </option> tag (element).