J
jceddy
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.
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.