Документация
HTML CSS PHP PERL другое
Working with Text Areas
 
Previous Page
Table of Contents
Next Page

Working with Text Areas

Text areas are created using the textarea element along with the rows and cols allow, and columns define how wide the box is (see Example 5-9).

Example 5-9. Creating a text area
<form method="get" action="http://www.myserver.com/cgi-bin/mailscript/">

<p>Please let us know if you have any special requests:</p>

<textarea rows="10" cols="25">

</textarea>

</form>

The resulting text area will have 10 rows and 25 columns (see Figure 5-10). I've added some text so you can see how it will appear when a visitor types text into the text area.


You can customize text areas a little more within the HTML, too. First, you might want to add the name attribute, which provides information that can be used by your form submission script to clarify its function.

Additionally, you can add an id attribute so you can attach scripts to the text area, if you so desire (see Example 5-10).

Example 5-10. A text area with name and id attributes
<form method="get" action="http://www.myserver.com/cgi-bin/mailscript/">

<p>Please let us know if you have any special requests:</p>

<textarea rows="10" cols="25" name="requests" id="requestbox">

</textarea>

</form>

Additionally, if you want to customize the text area a little more, you can type text into the text area markup:

<textarea rows="10" cols="25" name="requests" id="requestbox">

Type your comments here.

</textarea>

Your visitors will now see the text within the box. When they click in the box, they can remove your text and add their own (see Figure 5-11).

Figure 5-11. Text area with customized information to assist the site visitor.


    Previous Page
    Table of Contents
    Next Page


     Приглашаем посетить сайты 
    Мода Чехов Крылов Автомобили Шмелев Сологуб Успенский Жуковский Футбол CSS