WEB DESIGN GARAGE [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

WEB DESIGN GARAGE [Electronic resources] - نسخه متنی

Marc Campbell

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Working with Text Areas


Text areas are multiline fields for text input, as Figure 68.12 shows.

Listing 68.12. View Source for Figure 68.12.


<form>
<textarea name="typeTextHere" cols="50" rows="5">Type text here.</textarea>
</form>

Figure 68.12. Use text areas for multiline text input.

[View full size image]

The cols attribute of the textarea tag gives the horizontal size of the text area in characters, not pixels, while the rows attribute determines the vertical size of the text area in the number of lines. So, the example in Figure 68.12 is 50 characters wide and 5 lines tall.

The preset text of a text area appears between the textarea tags, not in a value attribute as with other widgets. If you don't want preset text, don't include any:


<textarea name="typeTextHere" cols="50" rows="5"></textarea>


GEEKSPEAK


In virtual wrapping, the form submits the text in the text area without extra carriage returns. In physical wrapping, the form submits the text with carriage returns at the end of each line.

By default, the text in a text area doesn't wrap. As the visitor types, the browser adds the new characters to the current line. Pressing Enter or Return causes a carriage return, and a new line begins.

The wrap attribute of the textarea tag changes this property. Setting this attribute to virtual or physical does the job:


<textarea name="typeTextHere" cols="50" rows="5" wrap="virtual"></textarea>

The type of wrapping affects the way the browser submits the form data. In virtual wrapping, the text appears to wrap in the text area, and the form submits the text as a continuous string of characters, without carriage returns (unless the visitor expressly creates them by pressing Enter or Return). In physical wrapping, the form submits the text exactly as it appears in the text area, complete with carriage returns at the end of each wrapped line.


/ 175