JavaScript: add text to textbox
Posted: Wed Mar 02, 2005 12:18 pm
I'm using similiar javascript function that "add emoticons" aka emoticons on this page, to add some special strings to textarea.
It allways adds the strings to the end of the existing text. I'd like to know if it's possible for javascript to detect the position of the cursor in the textarea and add strings into that position, into middle of the existing text?
Alternatively, id like to add the chosen string to clippoard, so it can be pasted where wanted. Is it possible to add stuff to clipboard by javascript?
It allways adds the strings to the end of the existing text. I'd like to know if it's possible for javascript to detect the position of the cursor in the textarea and add strings into that position, into middle of the existing text?
Alternatively, id like to add the chosen string to clippoard, so it can be pasted where wanted. Is it possible to add stuff to clipboard by javascript?