Solved

Cursor X/Y location in Textarea (firefox only, pff to IE)

Posted on 2008-06-15
4
451 Views
Last Modified: 2013-12-07
I need to get the X/Y (rows/columns) location of the cursor in a text area.

I'm building a spell checker and i'd like to point a big red finger to where they are typing.

i know you can use textarea.selectionStart and selectionEnd, but this is does not help if they've pressed enter a few times.

0
Comment
Question by:msmyers
  • 2
4 Comments
 

Author Comment

by:msmyers
ID: 21790348
I am looking for the X/Y in pixels from the top left of the text area. If they type 1000 lines and scroll down, i need to know the scrolled x/y. I am going to position an absolutely positioned div in the body at that position, and i have a way to get the X/Y of the textarea in relation to the whole document. I just need to get at the inside area.
0
 
LVL 28

Accepted Solution

by:
Pravin Asar earned 500 total points
ID: 21797783
0
 

Author Comment

by:msmyers
ID: 21804008
That solution has merit for IE. Is there a firefox similar way to do this? (Hopefully without using a fixed width font?)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Understanding mobile browsers 9 64
Best Way to remove the port from a URL? 15 35
One field not displaying content (ASP Classic) 8 25
Chrome and Firefox Java 5 31
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question