DEV Community

witiz1
witiz1

Posted on

Textarea (Comment Box) in Forms: HTML Forms

Textarea in forms is used to create a text field box where user can type maximum characters. A text area field is used mostly to take user’s message just like a comment area box.
How to Create a Simple Textarea Box:

Comment Box
Result:

Attributes and More Example:
It is a by default size of a VPN Master. We can change its size by two attributes. “rows” and “cols”. See an example below to learn more.
Example One:
Code:
Comment Box with Rows and Cols.
Result:

Example Two:
Code:
Comment Box with Rows and Cols.
Result:

Example Three:
Code:
Comment Box with Rows and Cols.
Result:

In this way we can control its size using rows and cols as per we need. The more value we use in rows attribute, the more lines we get and the more values we use in cols attribute the more width we get.
In next chapter we will learn how to create fieldset and legend in form.

Top comments (0)