HTML and CSS Reference
In-Depth Information
Figure 2.25: A simple form with input elements
In browsers that permit tabbing from one ield to the next, the ordering of
the ields is the same as the ordering of the elements in the code. his behavior
can be changed by adding a tabindex attribute to the form element:
<input type="text" name="addr" size="40" tabindex="20"/>
Wherever an ordering such as the tabindex attribute is used, I recommend
specifying numbers in increments of 10 to make it easier to insert new items or
rearrange the ordering later.
In the preceding form example, if a user entered the values Betty Boop ,
bboop@example.net , and 16 for the Name, Email, and Age ields, respectively,
the user's browser, if properly conigured, would create a new email message
addressed to <info@example.com> with the subject new user . he following
string would appear in the body of the message:
fullname=Betty+Boop&email=bboop%40example.net&age=16&web=
http%3A%2F%2F
he string is encoded using a method called URL encoding. Plus signs
(+) are substituted for blanks, and other special characters are replaced
by a percent sign (%) followed by the character's hexidecimal ASCII code.
he name=value pairs are separated from each other by the ampersand (&)
character.
his is not as user-friendly as we would like. Most websites, therefore, use a
general-purpose form-to-email CGI script such as Matt's Formmail script to
receive the contents of the input form and format it nicely for emailing.
But before we go too much further, let's see what else can be done with the
input element using other values for the type attribute. Take radio buttons,
 
Search WWH ::




Custom Search