Home All Groups Group Topic Archive Search About

Dragging and Dropping HTML instead of text

Author
24 Jun 2005 10:16 PM
Sammy Snyders
I'm trying to drag content into a rich text control and have it render the
formatted HTML instead of dragging in the plain text of the HTML.  It seems
like the javascript event.dataTransfer object can only handle text and URLs. 
I was hoping someone had attempted this or could offer some guidance on
making this happen.

Thanks for your time.

Author
29 Jun 2005 6:49 PM
Michael Baltic
You would need to grab the onmousedown event of the element you are dragging.

In the onmouseup event, if you released it over your target, then manually
pass the tag and style information.

You would have to do bounding box checks on the mouse position to determine
where the events fired.
--
Staff Consultant II - Enterprise Web Services - Cardinal Solutions Group

Future Business Model - National City Mortgage


Show quoteHide quote
"Sammy Snyders" wrote:

> I'm trying to drag content into a rich text control and have it render the
> formatted HTML instead of dragging in the plain text of the HTML.  It seems
> like the javascript event.dataTransfer object can only handle text and URLs. 
> I was hoping someone had attempted this or could offer some guidance on
> making this happen.
>
> Thanks for your time.