JavaScript EditorBest javascript editor debugger     Ajax website 



Main Page

Previous Page
Next Page

Creating Larger Text Areas

In some cases, you want to give the visitor more room to write. Unlike text boxes (see page 262), text areas may be as large as your page, and will expand as needed if the person enters more text than can fit in the display area. They're perfect for eliciting questions and comments.

Figure 17.34. The value attribute is not used with the textarea tag. Default values are set by adding text between the opening and closing tags (as in "Please share..." shown here).


To create larger text areas:

1.
If desired, type the explanatory text that will identify the text area.

2.
Type <textarea.

3.
Type name="label", where label is the text that will identify the input data to the server (and your script).

4.
Type rows="n", where n is the height of the text area in rows.

5.
Type cols="n", where n is the width of the text area in characters.

6.
Type >.

7.
Type the default text, if any, for the text area. No formatting is allowed here.

8.
Type </textarea> to complete the text area.

Figure 17.35. For some reason, I had to apply the font property directly to the textarea element to get it to take hold. It did not inherit from the body.


Figure 17.36. The visitor can override the default text simply by typing over it.


Tips

  • There is no use for the value attribute with text areas.

  • Visitors can enter up to 32,700 characters in a text area. Scroll bars will appear when necessary.

  • Both the rows and cols attributes are required.



Previous Page
Next Page


JavaScript EditorBest javascript editor debugger     Ajax website