473,670 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

iFrame execCommand focus problem

1 New Member
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 4902
acoder
16,027 Recognized Expert Moderator MVP
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
7610
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 fill the iframe with content (<body> tag and so on and also insert a <div> tag, inbetween is the content that should be modified). Now if the event "overflow" or "underflow" is triggered the iframe
4
7142
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. Is there a command to pass to execCommand for applying a style through a class attribute to the text? Does anyone know where can I find a reference with all the possible commands to execCommand? And also a reference to what is standard and what is...
2
1628
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 frame) .how to ?Thank you for help.
1
6137
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 value=1 OnClick="RichtText('Bold')"><b>B</b> <input type=checkbox name=under value=1 OnClick="RichtText('underline')"><u>U</u>
12
4332
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 which runs on both IE and firefox? Thanks in advance.... Code is below: <HTML> <Head> <Title>Simple Demo of HTML Area </Title> <Script Language="JavaScript"> function doBold() { ...
6
28328
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 <script language=javascipt> document.execCommand('print', false, null);
2
5105
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? Here is my code: <html> <head> <title>Auto print the page</title> </head>
0
8471
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8817
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7423
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5687
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2804
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1799
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.