Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit number of characters per line in text area to a fixed value

In my text area, I should be able to enter only 72 characters per line. If I use, cols property set to 72, it is allowing more or less number of characters depending on character width.

Can any one help how to do it?

like image 270
SKumar Avatar asked Mar 08 '11 17:03

SKumar


People also ask

How do I limit characters in a textarea?

Note − By default, we can enter data in a textarea upto 5,24,288 characters. In some cases, there is a need of putting a limit on the size of characters that can be typed in a textarea. So in that case, we can use maxlength attribute to control the number of characters entered in a textarea.

How do I limit the number of lines in a textarea?

We can define the visible width and height of a TextArea either using the cols and rows attributes or the style properties: width and height , but we cannot set a limit to the number of characters or the number of lines for the text entered into the TextArea by using HTML or CSS.


1 Answers

Duplicate of Textarea Limit characters per line Jquery or Javascript

<TEXTAREA NAME="HARD" COLS="72" ROWS="5" WRAP="HARD">
like image 80
Juan Mendes Avatar answered Nov 14 '22 08:11

Juan Mendes