Page 1 of 1

javascript and textarea

Posted: Wed Aug 17, 2005 9:02 pm
by Lixas
Hi all, can anyone help me to create script, which count in which line of textarea element is a cursor, and output it to input box or smthere else. In other words, i need that script get number of line, where is cursor. Guys, plz help me, because i'm trying to do my own CMS and i realy need it. Maybe some1 could give even directives to is, or smth else

Thanks, Lixas

Posted: Thu Aug 18, 2005 4:08 am
by Ken
You can probably find instructions somewhere.

Posted: Thu Aug 18, 2005 9:37 am
by Lixas
that is the point, i dont know where to find that instructions, i have visited a lot of sites, but i've never seen sumth like that what im searching now...

If some1 know smthing, plz post link or code

Posted: Thu Aug 25, 2005 8:31 am
by toychoq
Look for scripts tutorilas in google or infoseek.com

Posted: Mon Aug 29, 2005 6:08 pm
by Lixas
so, no1 knows how can i deal with this problem?? i realy need that... help guys, plzzz

Posted: Wed Aug 31, 2005 11:12 am
by SHAdmin
You can have a look at http://maddogsplace.co.uk/coding::javas ... cter-count and maybe get some hint onto how to do it.

Posted: Wed Aug 31, 2005 1:18 pm
by Lixas
Thanks You SHadmin, but that script is uselles. BTW i have found one such script, that count lines, but text in textarea must to be not wrapped...

Maibe i'll use it, and later, if i found that will work not only in IE, i will change :)

Posted: Fri Feb 24, 2006 8:52 am
by kaos_frack
count for "\n" in your textarea
number of lines will be "\n"+1