getSelectionRange in mozilla?

Discussion in 'Javascript' started by jen_designs@hotmail.com, Jun 22, 2005.

  1. Guest

    There is s function in mozilla called setSelectionRange where you set a
    start point and an end point for text to be highlighted in an input
    box. Is there a getSelection range that can tell me the character
    position that a user highlights in mozilla? Say there is a sentence,
    dhtml rules, if the users highlights dhtml, then the start point would
    be 0 and the end point would be 4. Any thoughts?
     
    , Jun 22, 2005
    #1
    1. Advertising

  2. wrote:

    > There is s function in mozilla called setSelectionRange where you set a
    > start point and an end point for text to be highlighted in an input
    > box. Is there a getSelection range that can tell me the character
    > position that a user highlights in mozilla?


    No, but text controls have properties
    selectionStart
    selectionEnd
    that your script can read.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 22, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Kingscott
    Replies:
    0
    Views:
    329
    Mike Kingscott
    Oct 27, 2003
  2. Robert Wagner

    Mozilla client side validation does not work

    Robert Wagner, Nov 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    366
    Robert Wagner
    Nov 6, 2003
  3. Robert Wagner

    Mozilla client side validation

    Robert Wagner, Nov 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    339
    Robert Wagner
    Nov 6, 2003
  4. Rocky Moore

    Client side validation on Mozilla..

    Rocky Moore, Nov 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    365
    wweric
    Nov 8, 2003
  5. Henri
    Replies:
    9
    Views:
    1,846
    Toby Inkster
    Feb 22, 2005
Loading...

Share This Page