HTML and CSS Reference
In-Depth Information
19
Creating a Form
Forms turn the Web into a two-way medium. Without forms, website owners could never hear
directly from their site visitors outside of other forms of communication. Forms are essential
to surveys, polls, contact requests, and online shopping. In this lesson, you learn the basics of
how forms are structured as well as the specifics for implementing the key form elements.
undersTandin
G ForMs
T
Tandin
A form is basically made of four parts:
The
<form> tag
Form controls, such as the
<input> tag
Labels, which identify the form elements
A trigger, typically a button form element, that submits the form
A simple form, in code, would look like this:
<form>
<label>Name:
<input type=”text” name=”fullName”
/>
</label>
<input type=”button” value=”Submit” />
</form>
When displayed in the browser, the label, text form
field, and button are presented all in a single line,
as shown in Figure 19-1.
FiGure 19-1
Search WWH ::




Custom Search