Friday, July 18, 2008

The <textarea> Tag

<textarea name="comment" cols="50" rows="5">Type your comment here</textarea>
This tag creates a multi-line text-entry area. The text content of the element is the default text that the text-area will contain. cols and rows specify the number of columns and rows. The default text should not contain any HTML.
It makes more sense to use the post method to submit a form if it has a text-area. Because unlike get, post does not have the 2048-characters-in-URL limit.
Non-standard attribute: wrap
By default, the text-area wraps lines to fit in the box. To disable this put the attribute wrap=off in the textarea tag.
Note that though by default the text-area wraps lines, it transmits the text exactly the way the user entered it. To have the virtual wrapping transmitted, use wrap=physical. To prevent the transmission of virtual wrapping use wrap=virtual.

No comments: