Chapter 6: Form Fundamentals
A form is a section of an
HTML document that is marked by <form> tags
(what else?). A form always contains two things and usually a third:
- Input elements where the user enters information, such as a text
box for entering text or a check box for selecting an option.
- A Submit button that the user clicks to send the information to its
destination.
- An optional Reset button that clears the form.
Figure 6-1 shows what a simple form looks like. This form has two text
boxes, one check box, and submit and reset buttons. A Web page can
contain multiple forms, each one being completely independent of the
others.
Figure 6-1. A Simple
HTML form.
Much of the power of
HTML forms comes from the fact that you can
control how the data is submitted. It can be placed in an email message
and sent to a specified address, or it can be sent to a specialized program
on the server that will process the data (for example, inserting it into a
database).