Online Book Reader

Home Category

HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [57]

By Root 1649 0
number of characters that are displayed.

♦ maxlength: Use this attribute to set the largest number of characters that are allowed.

There is no tag. Input tags are a holdover from the days when many tags did not have ending tags. You just end the original tag with a slash character (/), as shown in the preceding sample code.

You might wonder why I added the


Building a password field

Passwords are just like text boxes, except the text isn’t displayed. Instead, a series of asterisks appears. Figure 7-4 shows a basic password field.

Figure 7-4: Enter the secret password.

The following code reveals that passwords are almost identical to ordinary text fields:

“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

password.html

Enter a password

id = “pwd“

value = “secret“ />

In this example, I’ve created a password field with the ID pwd. The default value of this field is secret. The term secret won’t actually appear in the field; it will be replaced with six asterisk characters.

The password field offers virtually no meaningful security. It protects the user from the KGB glancing over his shoulder to read a password, but that’s about it. The open standards of XHTML and the programming languages mean passwords are often passed in the open. There are solutions — such as the SSL (Secure Socket Layer) technology — but for now, just be aware that the password field just isn’t suitable for protecting the recipe of your secret sauce.

This example doesn’t really do anything with the password, but you’ll use other technologies for that.


Making multi-line text input

The single-line text field is a powerful feature, but sometimes, you want something with a bit more space. The essay.html program, as shown in Figure 7-5, demonstrates how you might create a page for an essay question.

Figure 7-5: This quiz might require a multi-line response.

The star of this program is a new tag —

Here are a few things to keep in mind when using the tags.

Anything placed between in the code ends up in the output, too. This includes spaces and carriage returns. If you don’t want any blank spaces in the text area, place the ending tag right next to the beginning tag, as I

Return Main Page Previous Page Next Page

®Online Book Reader