HTML and CSS Reference
In-Depth Information
Table 6-3 Attributes and Functions of HTML Tags Used to Create Forms (continued)
Tag
Attribute
Function
<option>
</option>
selected
disabled
value
• Specifies whether an option is selected
• Disables a control
• Value submitted if a control is selected
<select>
</select>
name
size
multiple
disabled
• Name of the element
• Number of visible options in the select list
• Allows for multiple selections in select list
• Disables a control
<textarea>
</textarea>
name
rows
cols
disabled
readonly
• Name of the control
• Height in number of rows
• Width in number of columns
• Disables a control
• Specifies that a text area should be read-only; meaning not editable; can
be used with value attribute so text box or other input control has content
Creating a Form on a Web Page
In this chapter, you will modify the static Web page form used in the Blu Wav Music Web
site. The file, bluwavform.html, currently contains only text and does not utilize a form or
form controls (Figure 6-1a on page HTML 285). Using this static form is inconvenient
for the user, who must print the form, complete the required information, and then fax that
information to the phone number listed in the opening paragraph of text.
The file, bluwavform.html, is stored in the Data Files for Students for this chapter.
See the inside back cover of this topic for instructions on downloading the Data Files for
Students, or contact your instructor for information about accessing the required file.
After opening this file in Notepad++, you will enter HTML code to convert this static
Web page into the dynamic Web page form shown in Figure 6-1b on page HTML 285.
Plan
Ahead
Processing form information.
One of the most important issues to determine when creating a Web page form is what to
do with the information once it is entered. One way to process the information is to use a
CGI script, which is code that has been previously written in a language other than HTML.
The information collected from forms is often used to feed databases. A CGI script provides
a much better way to process that information. For the scope of this topic, we use the sec-
ond method to process information, the post. The post can be used to send the information
to an e-mail address.
Using a CGI script.
This action is beyond the scope of this topic, but it is the more
efficient way to handle the information input into the Web page form. A Web developer
would have to find out what script capabilities reside on the server in order to utilize it.
Posting to an e-mail address.
Because we do not know what CGI scripts are available
on the Web servers at your location, we will utilize the e-mail posting technique in this
chapter. The information posted to an e-mail address is not readily usable, so other steps
will have to be taken to utilize the data coming in via an e-mail message.
Search WWH ::




Custom Search