• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Forms > Labeling Input Fields

Labeling Input Fields

It was noted earlier in the chapter that it is up to you as a form author to include prompting text in front of your form fields to suggest to a user how he or she should fill in the field. The HTML 4.0 <LABEL> tag formalizes the relationship between the prompting text (the label) and the form field it is paired with. <LABEL> takes the FOR attribute, where FOR is set equal to the ID attribute value of the associated form field. In the example

<LABEL FOR="Zip">Enter your 9-digit ZIP code: </LABEL>
<INPUT TYPE="TEXT" NAME="ZIP" ID="Zip">


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint