471,071 Members | 1,234 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

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
Jul 23 '05 #1
2 6612
objectid.SelectedText = txtValue
Thomas wrote:
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


Jul 23 '05 #2
Thomas wrote:
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?


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
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Matt Tapia | last post: by
1 post views Thread by Matt Tapia | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.