inserting text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dean A. Hoover

    #1

    inserting text

    Is there an example somewhere of a function
    that will take 2 parameters: text and a text
    object (input type=text or textarea) and insert
    that text using the current selection point(s)
    for the specified object. The cursor should end
    up where you would expect it to and it should
    work in both IE and other popular browsers. Is
    something like that already floating around?

    Thanks.
    Dean Hoover

  • kaeli

    #2
    Re: inserting text

    In article <KzsLc.77071$bp 1.1613@twister. nyroc.rr.com>, dhxyz2010
    @yahoo.com enlightened us with...[color=blue]
    > Is there an example somewhere of a function
    > that will take 2 parameters: text and a text
    > object (input type=text or textarea) and insert
    > that text using the current selection point(s)
    > for the specified object. The cursor should end
    > up where you would expect it to and it should
    > work in both IE and other popular browsers. Is
    > something like that already floating around?[/color]

    MSIE for Windows, yes. All other popular browsers, including Safari,
    Konqueror, Mozilla, IE/Mac, and Opera, no, I don't think so. Last I
    checked there was a problem with getting the position of the cursor in
    some of those.
    Maybe someone has found a way. I'll be watching this thread. :)

    --
    --
    ~kaeli~
    If that phone was up your a$$, maybe you could drive a
    little better!



    Comment

    • Martin Honnen

      #3
      Re: inserting text



      Dean A. Hoover wrote:
      [color=blue]
      > Is there an example somewhere of a function
      > that will take 2 parameters: text and a text
      > object (input type=text or textarea) and insert
      > that text using the current selection point(s)
      > for the specified object. The cursor should end
      > up where you would expect it to and it should
      > work in both IE and other popular browsers. Is
      > something like that already floating around?[/color]

      See
      http://www.faqts.com/knowledge_base/.../13562/fid/130

      --

      Martin Honnen
      http://JavaScript.FAQTs.com/

      Comment

      • Dean A. Hoover

        #4
        Re: inserting text

        Martin Honnen wrote:[color=blue]
        >
        >
        > Dean A. Hoover wrote:
        >[color=green]
        >> Is there an example somewhere of a function
        >> that will take 2 parameters: text and a text
        >> object (input type=text or textarea) and insert
        >> that text using the current selection point(s)
        >> for the specified object. The cursor should end
        >> up where you would expect it to and it should
        >> work in both IE and other popular browsers. Is
        >> something like that already floating around?[/color]
        >
        >
        > See
        > http://www.faqts.com/knowledge_base/.../13562/fid/130
        >[/color]
        Good one. Thanks.

        Comment

        • Dean A. Hoover

          #5
          Re: inserting text

          Martin Honnen wrote:[color=blue]
          >
          >
          > Dean A. Hoover wrote:
          >[color=green]
          >> Is there an example somewhere of a function
          >> that will take 2 parameters: text and a text
          >> object (input type=text or textarea) and insert
          >> that text using the current selection point(s)
          >> for the specified object. The cursor should end
          >> up where you would expect it to and it should
          >> work in both IE and other popular browsers. Is
          >> something like that already floating around?[/color]
          >
          >
          > See
          > http://www.faqts.com/knowledge_base/.../13562/fid/130
          >[/color]
          I am trying to use what you pointed out to me (cool stuff)
          in conjunction with a DHTML menu package I purchased from
          apycom.com. The script you gave me fails when used with that
          package (on IE only) because the line:

          if (range.parentEl ement() == input)

          ends up being false. This is clearly some interaction
          with the DHTML menus I am using. I don't really understand
          much about these selection objects, as I am reading up on them
          in "Dynamic HTML". Is there some way to reset things when this
          function is called from the DHTML menu such that it will work
          like it does with the example HTML?

          Thanks.
          Dean Hoover

          Comment

          Working...