Limiting number of lines and letters in single line in textarea
Problem: I am trying to limit number of lines AND letters in each line in a textbox. What i got so far: So far i managed to limit lines count using this: var text = $(this).val(); var lines = text.split("\n"); if(e.keyCode == 13 && lines.length >= $(this).attr('rows')) { return false; } This won't allow user to push return key (keyCode 13) if the limit of lines is reached. The problem: Now i am trying to limit number of letters in a single line too, because if i reach end of my textarea (with return key) i still can hold a letter/write tons of text, and it will jump to another line when it