473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 4883
acoder
16,027 Expert Mod 8TB
Welcome to the site!

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

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

Similar topics

4
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I...
4
by: am75 | last post by:
Hi everybody, I'm developing web pages for content management using iframes, through which users can edit html portions... I found execCommand to apply simple formats (bold, italic...) to text....
2
by: zhanye815 | last post by:
This problem is this:a page is made up of frameset, but i can't visit the iframe(inline frame) of the frame in the framset.just like the frameset have 3 frames,the third frame have a iframe(inline...
1
by: Saint's Knight | last post by:
here is code that i use. <html> <head> </head> <body> <form> <input type=checkbox name=source value=1 OnClick="SourceCode(source.checked)">Source <input type=checkbox name=bold...
12
by: syedfasih | last post by:
I have created a text area using IFRAME. The problem is that it is working only in Internet Explorer not in Mozilla Firefox. Please help me regarding this problem. IS there any special command or tag...
6
by: arielzriel | last post by:
Dear All, I was looking for a solution to print Iframes in Internet Explorer 7 (IE7) the command window.print() ( even with window.focus) in an iframe does not work. The solution is ...
2
by: colinzhu | last post by:
I want to have the print dialog shown automatically after the the page is loaded, but when I try to call window.print() BEFORE the iframe, the print dialog is not shown at all. Anyone can help? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.