Creating Text Boxes

Text boxes can contain one line of free-form text—that is, anything that the visitor wants to type—and are typically used for names, addresses, and the like.

Figure 17.16. While it’s essential to set the name attribute for each text box, you only have to set the value attribute when you want to add default values for a text box.

To create a text box:

1.
If desired, type the label that will identify the text box to your visitor (for example, Name:).
2.
Type <input type="text".
3.
Type name="label", where label is the text that will identify the input data to the server (and your script).
4.
If desired, type value="default" ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.