Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1

(^354) Chapter 9 XHTML Forms
Let’s get started. Launch Notepad and open the contact.html file. Add a paragraph
below the

assigned to the content id element that says “Complete this form and
a Trillium representative will contact you.”
You are ready to configure the form area. The first XHTML in a form is the

element. Place your cursor on a blank line under the paragraph you just added and type
in a tag as follows:



As you read through the chapter you will find that a number of attributes can be used
with the element. In your first form, we are using the minimal XHTML needed
to create the form.
To create the form control for the visitor’s e-mail address to be entered, type the follow-
ing XHTML:
E-mail:



This places the text “E-mail:” in front of the text box used to enter the visitor’s e-mail
address. The tag has a typeattribute with the value of text that causes the
browser to display a text box. The nameattribute assigns the name CustEmailto the
information entered into the text box (the value) and could be used by server-side
processing. The idattribute is included for forward compatibility with XHTML. Since
the tag is a self-contained tag, it needs to be closed with />. The

elements configure line breaks.
Now you are ready to add the submit button to the form. The XHTML code is as
follows:

Figure 9.4
The contact page
Free download pdf