Results 1 to 2 of 2

Thread: (SORTED, thanx) Cursor location

  1. #1

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303

    Question (SORTED, thanx) Cursor location

    Is it possible using JS to find the cursor location. I'll explain why and there may be another way.

    I've got a textarea and I type say 'hello this is a test, blah blah' and my cursor is postioned just after the word 'is'. I want to be able to click a button and insert some text there or anywhere, where my cursor is located.

    Is this possible?
    Last edited by parkes; Aug 15th, 2002 at 09:07 AM.
    Thanks in advance for any help provided.

    VB 6 Enterprise Edition SP4
    ADO, SQL 7/2000, ASP and some JavaScript


    >> Life goes on, but for how long? <<
    If you can smile when things go wrong, you have someone in mind to blame

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    yes, it is, but it requires a lot of code. What you want to do is return the position of the caret in the text box rather than the whole mouse position.

    http://www.faqts.com/knowledge_base/...d/1052/fid/130

    If you are interested you can get the mouse position too.

    http://getelementbyid.com/tutorials/...se/index.shtml
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width