javascript and textarea

Any problem with javascript can be discussed here.
Post Reply
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

javascript and textarea

Post 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


Image
Ken
Posts: 18
Joined: Thu Aug 18, 2005 3:33 am

Post by Ken »

You can probably find instructions somewhere.
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post 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
Image
toychoq
Posts: 108
Joined: Fri Apr 15, 2005 9:11 am

Post by toychoq »

Look for scripts tutorilas in google or infoseek.com
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

so, no1 knows how can i deal with this problem?? i realy need that... help guys, plzzz
Image
SHAdmin
Posts: 2089
Joined: Sat Dec 18, 2004 11:28 am
Contact:

Post 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.
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post 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 :)
Image
kaos_frack
Posts: 504
Joined: Sat May 07, 2005 8:03 am
Contact:

Post by kaos_frack »

count for "\n" in your textarea
number of lines will be "\n"+1
Post Reply