Working with Text Fields

Text fields are single-line widgets for text input, as in Figure 68.13. Text fields are probably the most common widget on the Web.

Figure 68.13. Use text fields for single-line text input.

The width of the text field—in characters, not pixels—appears in the size attribute. The maximum number of characters that the visitor can type into the field appears in the maxlength attribute, and the default text appears in the value field.

Listing 68.13. View Source for Figure 68.13.
<form>
  <input type="text" name="typeTextHere" value="Type text here." size="50" maxlength="80">
</form>

When you click inside ...

Get Web Design Garage 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.