Quackit Logo

Got a MySpace Page?

Get "www.yourname.com" for your MySpace page. Learn how >>.

HTML Text Box Code

Print Version

You can use the following code as a basis for adding a text box to your website. This will enable your users to provide multi-line comments. Most browsers will render scroll bars on the text box as soon as its contents (i.e. users' comments) are too big for it.

To use this text box code, simply copy and paste it into your website and change the values to suit.

This HTML Text Box Code...

<form method="post" action="">
<textarea name="comments" cols="40" rows="5">
Enter your comments here...
</textarea><br>
<input type="submit" value="Submit" />
</form>

...results in the following text box:


Customize Your Text Box

You can change the look of your text box by changing the value of the attributes. Attributes are the bit that look something like someattribute="somevalue" (for example, cols="40" ).

You can use the following templates as a basis for your HTML text box codes. Simply fill in the blanks or remove uneeded attributes.

1. The Text Box Tag

For an explanation of all the attributes, see the HTML textarea tag specifications.

<textarea
	name=""
	rows=""
	cols=""
	class=""
	id=""
	dir=""
	lang=""
	title=""
	style=""
	readonly=""
	disabled=""
	tabindex=""
	onfocus=""
	onblur=""
	onselect=""
	onchange=""
	onclick=""
	ondbclick=""
	onmousedown=""
	onmouseup=""
	onmouseover=""
	onmousemove=""
	onmouseout=""
	onkeypress=""
	onkeydown=""
	onkeyup=""
>

</textarea>

2. The HTML Form Tag

Note that text boxes are part of an HTML form. The HTML form tag also accepts its own attributes, as follows:

For an explanation of all the attributes, see the HTML form tag specifications

<form
	action=""
	method=""
	enctype=""
	accept-charset=""
	accept=""
	name=""
	class=""
	id=""
	dir=""
	lang=""
	target=""
	onSubmit=""
	onReset=""
	onclick=""
	ondbclick=""
	onmousedown=""
	onmouseup=""
	onmouseover=""
	onmousemove=""
	onmouseout=""
	onkeypress=""
	onkeydown=""
	onkeyup=""
>

</form>

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
                     
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!