473,406 Members | 2,371 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,406 software developers and data experts.

re-route events in IE (or rich text woes)

Well, there is something here I'm working on, and I have a problem that
has several possible solutions...none of which I can figure out how to
implement.

Basically, I am creating a rich text editing element, using design mode
in IE, that validates/cleans up the contents of anything that is pasted
into it.

The element that has design mode on is the body of a page nested within
an IFRAME in the main page.

The problem is this: If the user pastes something into the document
using CTRL-V, I am able to detect the paste and go ahead to validate
the new contents of the document. If, however, the user pastes
something into the document by DRAGGING it from another source, there
doesn't seem to be an event that I can capture.

The ondrag/drop events seem to be disabled in IE in designMode, and
when something is being dragged, no mouseover/down/up events fire. The
document body doesn't seem to have an onpaste event that I can capture,
though I have seen this event on other elements.

So...possible solutions?

Is there any way to disallow drag/drop pasting in an element in IE with
design mode turned on?

I could put an "invisible" div over the IFRAME, to control access to
the IFRAME, but then I need a way to re-route the appropriate events
(onmousedown, onmouseup, etc.) to the IFRAME from the invisible
div...anyone know of a way to do that?

I could manually move the cursor, selection, etc., around in the
IFRAME...IF I could figure out a way to move the cursor/change the
selection in an element with designMode on, based on the mouse
position...but I can't seem to figure out a way to do that, either.

I'm going to try embedding a DIV that takes up the whole window in the
IFRAME, and have THAT be the rich text cotnainer, because maybe it will
be easier to capture the onpaste events...we'll see.

Aug 11 '06 #1
2 2515
OK, looks like I was making it more complicated than need be.

If, instead of setting the designmode of the IFRAME's document to on, I
just include "contenteditable" in the IFRAME document's BODY tag, I can
capture the onpaste events.

It might still be interesting to see if some of the other things I was
trying to do could be done, though...

Aug 11 '06 #2
Heh...so now my code for finding the cursor position doesn't work...

Anyone know a way to detect the position of the insertion point in a
textarea that doesn't involve resetting the innerHTML?

Aug 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
1
by: PC User | last post by:
I found this Rich Text Editor and I've been trying to recreate it in my own application. I've had trouble with the COMCTL.ImageListCtrl and the COMCTL.Toolbar to recreate the toolbar. And I've...
0
by: Mark C. | last post by:
I'm trying to program drag drop in a rich text box that is similiar to what you would see in wordpad, Word, etc. specifically, I'd like to move/copy text using drag drop. I can't seem to get the...
1
by: Peter | last post by:
I have written a small terminal app that reads and writes to the serial port. In particular as the data is read from the serial port it is appended to the rich text box. The problem I am...
0
by: ray well | last post by:
hi, my app has two parallel rich text boxes containing the same content in 2 different languages. the lines parallel each other, line #3 in english contains the same content as line #3 in...
0
by: william_dudek | last post by:
I have created a control with a rich text box, and I need to capture the paste event to do some additional work when a user pastes text. I can't do this on hte text change because Someone could...
1
by: tomi.trescak | last post by:
Hi I have a problem with storing rich text in MySQL. I store rich text in MySQL (in column with type "text") which i get from Rich Textbox control. When i do reverse processing by trying to...
4
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.