count lines in a textarea
Posted on 2005-04-06
Hi guys !!
it's urgent, so I'm rewarding the maximum amount of points allowed !
I need to count the number of lines a text is taking in a textarea. My first try is splitting the text by the line feed (\n), but it do the work just partially. I mean it just split when there's an explicit line feed (by the user hitting enter) but it does nothing regarding the automatic line feeds, when the text reaches the right margin of the textarea and automatically goes on the next line. Any ideas? Please test it a little before posting, I've already tried several things. Thanx everybody.