Textareas
Posted by admin | Posted in HTML Tutorial | Posted on 11-08-2010-05-2008
0
Textareas retrieve descriptive type of information from the user. Paragraphs, essays, or memos can by cut and pasted into textareas and submitted. Textareas have an opening and a closing tag, any words placed between them will appear inside your text area. It can take large inputs, and have scroll bars to navigate within the text entered.
Example:
<textarea>Text Area!</textarea>
Text area Cols and Rows
We can display the text area according to our choice by using the rows and cols attribute.
Use a numeric value for each attribute and the larger the value the larger the field will appear.
Example:
- <textarea cols=”20″ rows=”10″>Text Area!</textarea>
- <textarea cols=”40″ rows=”2″>Text Area!</textarea>
- <textarea cols=”45″ rows=”5″>Text Area!</textarea>
Textarea Wrap
The wrap attribute refers to how the text reacts when it reaches the end of each row in the text field. Wrapping can be one of three settings:
· soft
forces the words to wrap once inside the text area but when the form is submitted, the words will no longer appear as such (Line breaks will not be added).
· hard
Hard wraps the words inside the text box and places line breaks at the end of each line so that when the form is submitted it appears exactly as it does in the text box.
· off
Off sets a textarea to ignore all wrapping and places the text into one ongoing line.
· wrap=
o “virtual”
Virtual means that the viewer will see the words wrapping as they type their comments, but when the page is submitted to you, the web host, the document sent will not have wrapping words.
o “physical”
Physical means that the text will appear both to you, the web host, and the viewer including any page breaks and additional spaces that may be inputed. The words come as they are.
Example:
- <textarea cols=”20″ rows=”5″ wrap=”hard”>As you can see many times word wrapping is often the desired look for your textareas. Since it makes everything nice and easy to read.</textarea>
Example:
- <textarea cols=”20″ rows=”5″ wrap=”off”>As you can see many times word wrapping is often the desired look for your textareas. Since it makes everything nice and easy to read.</textarea>
