![]() |
|
To set up a text box with more than one line, you use the <textarea> tag. It creates a box in the form complete with the necessary scroll bars. For example:
The cols attribute specifies the width of the box in characters and the rows attribute the number of lines you want. In the <textarea> tag, you can type in plain ASCII text. You often see this on pages as a box for comments or as a way to provide instructions:
You can not put any other HTML tags or formatting in the tag. One thing to watch for: if you enter information into a text area created by Netscape, all of the text appears on a single line unless you enter a carriage return. This can seem a bit odd because people expect text to wrap automatically (like in a word processor). Internet Explorer, on the other hand, wraps as you type. You could use the wrap attribute for the <textarea> tag to make sure text wraps: <textarea cols="20" rows="5" wrap="on"> You can also use wrap="off" to disable word wrap in Internet Explorer. Two other wrap options:
You can also use the name attribute to add an internal name to the field so the program that handles the form can identify the fields. |
More information Multi-line text boxes |