I'm currently developing a sort of browser based word processor and am using a textarea to hold the contents. The textarea has a height set to 100% to fill a container div with padding and other elements in it. Is there a way I can calculate the number of rows that will fit in the textarea without overflowing so I can prevent additional lines from being created? I could of course just hide the overflow, but I don't want that excess text to get saved when I push the contents to a database.
↧