A question for Chris M
-
Why does the insert smiley function always place the smiley at the end of the post instead of where the cursor is? I always write the post then want to insert the smileys where I want them and cutting and pasting them is a pain in the butt.:mad: (all right maybe not :mad: - more like:(( or :confused: ).:) Dave Huff 'tis a silly place!
-
Why does the insert smiley function always place the smiley at the end of the post instead of where the cursor is? I always write the post then want to insert the smileys where I want them and cutting and pasting them is a pain in the butt.:mad: (all right maybe not :mad: - more like:(( or :confused: ).:) Dave Huff 'tis a silly place!
That's a good question, Dave! I've wondered the same...
-
Why does the insert smiley function always place the smiley at the end of the post instead of where the cursor is? I always write the post then want to insert the smileys where I want them and cutting and pasting them is a pain in the butt.:mad: (all right maybe not :mad: - more like:(( or :confused: ).:) Dave Huff 'tis a silly place!
I guess it is so because it might be impossible or extremely difficult to accomplish cursor based positioning using mere Javascript. Nish
Check out last week's Code Project posting stats presentation from :- http://www.busterboy.org/codeproject/ Feel free to make your comments.
-
Why does the insert smiley function always place the smiley at the end of the post instead of where the cursor is? I always write the post then want to insert the smileys where I want them and cutting and pasting them is a pain in the butt.:mad: (all right maybe not :mad: - more like:(( or :confused: ).:) Dave Huff 'tis a silly place!
The main problem is getting at the insertion point. The "minute" the cursor (focus) leaves the textarea, the insertionpoint is "lost". If you select some text in the textarea, you can replace that text, or fi insert tags around it (once you've asserted that the selection is actually in the textarea, and not somewhere else on the page), because the selection survives the click on the button. But if the cursor is just sitting there, doing it's thing, quietly blinking away, as it would if you want to insert a smiley somewhere, the browser looses the insertion point. - Mort