Skip to Main Content
HTML & XHTML: The Definitive Guide, 6th Edition
book

HTML & XHTML: The Definitive Guide, 6th Edition

by Chuck Musciano, Bill Kennedy
October 2006
Intermediate to advanced content levelIntermediate to advanced
680 pages
21h 44m
English
O'Reilly Media, Inc.
Content preview from HTML & XHTML: The Definitive Guide, 6th Edition

Multiline Text Areas

The conventional and hidden-text types for forms restrict user input to a single line of characters. The <textarea> form tag sets users free.

The <textarea> Tag

As part of a form, the <textarea> tag creates a multiline text-entry area in the user's browser display. In it, the user may type a nearly unlimited number of lines of text. Upon submission of the form, the browser collects all the lines of text, each separated by %0D%0A (carriage return/line feed), and sends them to the server as the value of this form element, using the name specified by the required name attribute.

You may include plain text inside the <textarea> tag and its end tag (</textarea>). That default text must be plain text, with no tags or other special elements. The user may modify the contents and the browser uses that text as the default value if the user presses a reset button for the form. Hence, the text content is most often included for instructions and examples:

Tell us about yourself:
<textarea name=address cols=40 rows=4>
  Your Name Here
  1234 My Street
  Anytown, State Zipcode
</textarea>
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CSS Master, 3rd Edition

CSS Master, 3rd Edition

Tiffany B Brown

Publisher Resources

ISBN: 0596527322Errata Page