html – Limit text area to 6 lines (Rows) in Javascript-ThrowExceptions

Exception or error:

I’m trying to limit the user to only 6 lines of text (Or rows) in the textarea.
If I limit the characters to for example 60 lines, the user can enter 59 times and have a character in the line 60. I want to avoid that by limiting the user to 60 characters but in a max 6 lines in the textarea. Or disable the enter button in the text area will also do the trick. I found some solutions for jquery but I’m trying to stay with Javascript/React.

How to solve:

If I understand correctly, you have a couple of options:

Leave a Reply

Your email address will not be published. Required fields are marked *