Jump to: navigation, search

HTML form input textarea

From w3cyberlearnings

Contents

HTML - TextArea Field

Textarea input field is a multiple line user input text.

HTML - Syntax TextArea Field

  • Rows: defines the total rows
  • Cols: defines the total column
  • Name: textarea name
  • Default Text: default content
<textarea rows="4" cols="4" name="something">Default Text</textarea>

Example - Attributes

Attributes Value Example Description
cols number <textarea cols="5" name="somet">..</textarea> specifies the width of the textarea
rows number <textarea cols="5" rows="29" name="somet">..</textarea> specifies the height of the textarea
disabled disabled <textarea cols="5" rows="20" disabled="disabled" name="somet">..</textarea> disable the textarea
name text <textarea cols="5" rows="20" disabled="disabled" name="somet">..</textarea> name the textarea
readonly readonly <textarea cols="5" rows="20" readonly="readonly" name="somet">..</textarea> textarea should be read only

Example TRY-IT

<html>
<head>
	<title>Textarea</title>
</head>
<body>
	<textarea rows="4" cols="20" name="infor22">please put your comments
	</textarea>
	<textarea rows="5" cols="20" name="infor22" disabled="disabled">Disabled it
	</textarea>
	<br/>
	<textarea rows="6" cols="22" name="infor22">please put your comments
	</textarea>
	<textarea rows="18" cols="30" name="infor22">please put your comments
	</textarea>
</body>
</html>

Output

Html form textarea 1.png

Related Link


Navigation
Web
SQL
MISC
References