insert text at cursor position

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas

    insert text at cursor position

    Hi there,

    I'd like to insert a text into a textarea at the current cursor position
    when you click on a button, but I only found out how to insert a text at
    the end of the textarea. Is it possible to insert text at cursor position
    and if it is, how can I do it?


    Thanks for any help


    Thomas
  • Balaji. M.

    #2
    Re: insert text at cursor position

    objectid.Select edText = txtValue


    Thomas wrote:
    [color=blue]
    > Hi there,
    >
    > I'd like to insert a text into a textarea at the current cursor position
    > when you click on a button, but I only found out how to insert a text at
    > the end of the textarea. Is it possible to insert text at cursor position
    > and if it is, how can I do it?
    >
    >
    > Thanks for any help
    >
    >
    > Thomas[/color]

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: insert text at cursor position

      Thomas wrote:
      [color=blue]
      > I'd like to insert a text into a textarea at the current cursor position
      > when you click on a button, but I only found out how to insert a text at
      > the end of the textarea. Is it possible to insert text at cursor position
      > and if it is, how can I do it?[/color]

      Google ist your friend. [psf 6.1]

      <http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130>

      And the Gecko DOM (used by Mozilla/5.0) provides selectionStart
      and selectionEnd properties for HTMLTextArea objects.


      PointedEars

      Comment

      Working...