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 are too big for it.

To make this text box do something, simply place it within a form that submits the contents to the server for processing.

Basic Text Box

View Output

Customizing your Text Box

You can change the color, add borders, and add a background picture to your text box. Here are some examples.

Color

View Output

More Comment Box Colors →

Background Image

View Output

More Comment Box Pictures →

Borders

View Output

More Comment Box Borders →

Scrollbars

View Output

More Scrollbars →

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 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 form.