The <textarea> tag is a special input element of forms that can be tricky to use well.
The textarea tag creates a multiple-line text input field in the browser. It allows the customer to type in nearly unlimited lines of text. When the form is submitted, these lines are sent to the server as the value of the name of the textarea. If your reader hits enter in the field, it is sent to the server as
CR/LF. The textarea tag must always be followed by the closing </textarea> tag.
This tag has several commonly used attributes:
The cols attribute indicates how many columns wide the textarea should be. It is measured in characters. So if you write
cols="30", your textarea will be 30 characters wide.
The rows attribute defines how many rows down the textarea should be. Like cols, rows is measured in characters. So if you write
rows="5", your text area will be 5 line-heights tall.
Both cols and rows are required in valid HTML 4. You will find that your readers will not want to type more than there is space available (even though there are scroll bars to include additional text), so this is a good way to try to limit the text submitted by a small amount.
But remember that unless you include a script to limit the length of the submission.
This article is part of the HTML Forms Tutorial