SQL PHP HTML JavaScript articles and free code
 

Text Area

Text Area is nothing but multiline textbox. TextArea is mainly used when the user has to enter large amount of text. TextArea field can be created as :
<TextArea name="txtArea" rows="<number of rows>" cols="<number of columns>">
<Default text of the textArea>
</TextArea>

Attributes of TextArea Field:
Name: Specifies the name of the object through which it can be referenced.
Rows: Specifies the height of the textarea in characters.
Cols: Specifies the width of the textarea in characters.
Wrap: Specifies how the text is wrapped when it reaches the right-hand edge of the textarea box. This attribute possibly takes the following values
Off: If the wrap attribute is set to 'Off' then the text will not wrap and is submitted as it is entered by the user.
Readonly: This attribute will not let the user change the contents of the field.

Example:
<TextArea name="txtArea" rows=5 cols=35>
This is the default text
</TextArea>
This places a textarea field within the HTML form, which can be referenced by using its name "txtArea" and whose value is "This is the default text" and with a height of 5 rows and width of 35 columns. The textarea looks like...



Freezing textarea for editing
We can set the text area not to edit by the user by defining the property readonly='readonly' . This is required when we want visitors not to add any text but only to use the existing text only.

Here is the code for it.
<textarea name=y_msg rows=3 cols=40 readonly='readonly'></textarea>

Here is the demo.

Discuss this tutorial at forum

List of HTML Tutorials

Form Fields  | Text Field  | Hidden Field  | Password Field  | TextArea  | RadioButton  | Checkbox  | Button  | Image Button  | Submit Button  | Reset Button  | Drop-Down Menu
 

Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.

Scripts
PHP
JavaScript
List of HTML Tutorial
<Form>
HTML Tags
Color Chart
HTML Calendar
Tags on web page
Web Design
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.