I would like to add a <textarea>
on my web page. Which can contain a maximum of 21 lines. I would like to prevent the re-sizing of the text area when more elements are coming to the page. I partially gain it by giving the maxlength
property. But the count using line number is not effective. Because if someone give 1 new line and type some data then the line order will give a true value but the max length give wrong value.
suppose if my textarea has maxlength=100
and one line can contain upto 10 letters. And I limit the row number as 10. If I give 10 blank enter
key press, then it will stop at line 10. And if I give 100 characters, then also it will work correctly. But if I type 1 character on !st line, Then Press Enter
and one character on second line then press Enter
. Then the text area will allow 98 more characters, which will resize the textarea
Is there any way to prevent re-sizing using the width of textarea? Please help