Forum Moderators: open
So the plan is to get the content of the text box. Split it into an array of lines with \n or \r, find the current cursor location and get that line. count the line and spit the result to a textbox.
Sound possible?
I have never used cursor position before.
Is it that you want the character count of each seperate line to be limited?
It would be simple enough to detect that (using your method of splitting/counting), then alert the user that line x has too many characters. I would assume that if you run the check in an onchange, then whatever line they are currently editing would be the problem line, so you could just say "you've entered too many characters on this line", and the user would assume it is referring to the line on which they are currently typeing...
- JS