htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
HTML insert outside of textarea (IE6)


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


JCollum
Novice

Nov 5, 2004, 6:46 PM

Post #1 of 5 (3082 views)
Shortcut
HTML insert outside of textarea (IE6) Can't Post

I've seen some posts about this but no solutions.

In IE when I do an insertHTML sometimes the HTML is pasted outside of the text box. Doesn't happen in FF. The only solution that I can think of is doing a setFocus after the insertHTML. I don't know how to do that but it can't be that tough.

I've noticed that it only happens if I do the insert twice without clicking the textarea in between inserts.


JCollum
Novice

Nov 13, 2004, 12:03 AM

Post #2 of 5 (3005 views)
Shortcut
Re: [JCollum] HTML insert outside of textarea (IE6) [In reply to] Can't Post

Bump - no one has a theory on this one?


novocaine
Novice

Nov 14, 2004, 7:01 AM

Post #3 of 5 (2982 views)
Shortcut
Re: [JCollum] HTML insert outside of textarea (IE6) [In reply to] Can't Post

Before executing the insertHTML, you'll have to call the function editor.focusEditor();


Code
   

editor.focusEditor();
editor.insertHTML('my html code');


That should do the trick ;)


JCollum
Novice

Nov 14, 2004, 7:40 AM

Post #4 of 5 (2976 views)
Shortcut
Re: [novocaine] HTML insert outside of textarea (IE6) [In reply to] Can't Post

That's so simple! Thanks for your help with this. I assumed it would be a bit of work.


tblack1100
New User

Feb 3, 2005, 2:16 PM

Post #5 of 5 (2649 views)
Shortcut
Re: [novocaine] HTML insert outside of textarea (IE6) [In reply to] Can't Post

If I call focusEditor() before calling insertHTML(), it sets the cursor position to the beginning of the text in the editor instead of where my cursor was located before I clicked on the button.



Thanks

 
 
 


Search for (options)