Exercise 6 Demo: Part A : Forms
Setting Up a Form
A form is created using the
<form> </form> tags. EVERYTHING in a form must go between these two tags.
The basic part of a Form itself is pretty simple - interactive buttons to push, pulldown menus and boxes to fill with information.
Within the opening form tag, you specify three attributes:
method="x"Tells the browser how to send the data from the form. The possible values for "x" are "post" and "get". The preferred value is "post".
action="url"Tells the browser where to send the data from the form.
enctype="x"Specifies how the form will be encoded. There are two possible values: "text/plain" and "multipart/form-data". Generally the preferred value is "text/plain"
The simplest way to send a form is to use a "mailto:" and use your email address:
action="mailto:email@example.com". This will send the results to your email.
Your code for this opening form tag will look like this:
<form method="post" action="mailto:firstname.lastname@example.org" enctype="text/plain">.
Sending forms directly by email is not usually recommended, since the information can easily be intercepted. Therefore, NEVER send confidential information this way. However, for the simple forms in this demo, and for this project, it is fine to use this method.
In the next three parts of this demo we'll add several different types of data input types. After finishing all three demos, don't forget to close your form tag.
For more about Forms (input types) go to Part B of Demo 6.
Go back to the Exercise 6 page.
© Claudia Faulk. Updated 6.18