Comment Box Code

You can use the following HTML code to create a comment box within your HTML document.

Example Comment Box Code:

The following comment box code consists of a form containing a small textarea (the comment box) and an input field (the submit button).

View Output

Note that the above code assumes that there's an "action page" to process the contents of the form. In this example, html_form_tag_action.cfm (located in the /html/tags/ directory) is the server-side script that processes the form.

To learn more, check out Add Comments to Website.

Color

See how easy it is to change the background color of your comment box.




More Colored Comment Boxes →

Background Picture

You can also add a background image to your comment box.




More Comment Box Pictures →

Scrollbars

Customize the scrollbars (only works on WebKit browsers such as Chrome, Safari, and Opera).

Efficient honorificabilitudinitatibus cross-media information without floccinaucinihilipilification cross-media value. Quickly maximize timely deliverables for real-time schemas plenipotentiary.
Efficient honorificabilitudinitatibus cross-media information without floccinaucinihilipilification cross-media value. Quickly maximize timely deliverables for real-time schemas plenipotentiary.
Efficient honorificabilitudinitatibus cross-media information without floccinaucinihilipilification cross-media value. Quickly maximize timely deliverables for real-time schemas plenipotentiary.

More Scrollbars →

Borders

Heck, while you're at it, why not add a border too!




More Borders →

Send Email from your Comment Box!

You can use your comment box to create a feedback form that sends you an email every time someone clicks the submit button. All you need to do is change the value of the action attribute to a script that processes the form and sends you an email.

Here's an example of what I mean. This page provides you with all the code you need to create a feedback form.

Further Details

This info aims to help you understand the above code, which consists mainly of HTML tags (or HTML elements).

The form tags contain other tags nested within them. These other tags define the actual form elements that appear within the form - such as the actual comment box (otherwise known as the "textarea").

You can use the following template as a basis for your HTML comment box code. Simply fill in the blanks or remove uneeded attributes.

1. The <form> Tag

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

2. The <textarea> Tag

This tag defines the comment box within the form.

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

3. The <input> Tag

This tag defines input fields within the form and can be used for defining the submit button of the comment box.

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