![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New Coder ![]() Join Date: Feb 2003
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Insert into a textarea
Hi,
I have this code that lets me insert text into a textarea from a button. Currently, it inserts the text at the end of what is in the textarea. Is there a way to make it insert where the cursor is instead? <script> function inser1() { document.getElementById('ip').value+= '<firstName>' } </script> thanks, jo |
|
|
|
|
|
PM User | #3 |
|
Senior Coder ![]() Join Date: Aug 2006
Location: FL
Posts: 1,096
Thanks: 1
Thanked 188 Times in 185 Posts
![]() |
I summitted a solution to another forum recently and it worked for them.
Try: http://www.webdeveloper.com/forum/s...ad.php?t=110464 Or look into: http://www.sitepoint.com/forums/showthread.php?t=296023 How can I manipulate the selection and the caret in an input type="text" element in Mozilla browsers and IE/Win? http://www.alexking.org/blog/2003/0...ing-javascript/ http://www.massless.org/mozedit/ http://parentnode.org/javascript/wo...ursor-position/ |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|