HTML Text Box Code

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.

MySpace Users: If you need a text box for your MySpace profile, use the MySpace comment box code

This HTML Text Box Code...

CodeResult


Customizing your Text Box

You can change the color, add borders, and add a background picture to your text box. Here are some examples from the 'comment box' section of our website:


Change the color of your text box!


Add a background image to your text box!


Add borders to your text box!

Text Box Templates

You can also change things about your text box such as the size, how many rows/columns it has, and much more.

You modify 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 page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!

Sponsored Link: Design CODE-FREE Websites

Check a Domain:

ZappyHost Logo