
09-20-2006, 10:34 AM
|
|
SEO Junior and a half
|
|
Join Date: Oct 2005
Posts: 42
|
|
|
Javascript within an editable iframe
I'm trying to make an advanced text editor on the web, I think my best option is an iframe (a text area like this forum uses isn't sufficient since you can't decorate text within the textarea). I'm working with something very simililar to the editor on http://devedge-temp.mozilla.org/vie...1/index_en.html.
My problem (also a problem on site above), when you type something in IE and click outside of what you typed (like the middle of the iframe), the cursor goes to the end of the text, exactly what I want, this doesn't happen in mozilla, you have to click next to the text to get the cursor to move to the end of the text. One solution I was thinking about is adding an onclick event to the area of the iframe that moves the cursor to the end of the text, but since the iframe is not an html element (something like that) you can't add javascript functions, and since the iframe is in designMode any javascript I add in the iframe source doesn't work that (does when designMode is off). Any help is apprechiated.
|