469,294 Members | 1,940 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,294 developers. It's quick & easy.

iFrame execCommand focus problem

I'm having some problems on IE with a small editor I'm building. The source of the problem is the following:

Consider having an iFrame with designMode="on" in which you select some text. When clicking anywhere in the page (outside de iframe), the iFrame looses focus and selection. However, this doesn't happen for images. When clicking on images the iFrame keeps its focus.

So, all my toolbar buttons (Bold, Italic, OL, UL... s.o.) that have images behind, fire execCommand properly on the selection. However, the more complex options like ForeColor, FontName (which uses an absolute positioned <div> to popup and offer the choices), steel the focus when clicking on them. Therefor, when the actual execCommand fires, the iFrame has already lost the selection -> nothing happens.

This only happens in IE. Firefox works just fine.

Has anyone encountered something like this before? Are there any workarounds to prevent the iFrame from loosing focus and selection? Any other solution or opinion is most welcomed.

Thanks a lot!
Mar 25 '08 #1
1 4718
16,027 Expert Mod 8TB
Welcome to the site!

This example (using an iframe) seems to work.
Mar 26 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by am75 | last post: by
2 posts views Thread by zhanye815 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.