473,322 Members | 1,473 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,322 software developers and data experts.

onDrop event not working correctly

Hi,

Been trying to work through a simple drag and drop interface using either IMG,
SPAN or DIV tags. That way I can define blocks of text and/or graphics as
draggable and be able to drop them on a similar (img, div, span, etc.) target,
preferably an image.

I can highlight text from an "<input type=text>" field and reach a target to
trigger an event (e.g. alert();), but can't get the same response when the
dragged item is a block of text or an graphic and drop it on either of the same
targets.

Example Page: http://web.newsguy.com/fp2000/testdnd.html

The Microsoft site mentioned that the onDrop event has some default
characteristics that limit the dragged object to an input field, but other tags
can be used if the "ondragover="window.event.returnValue=false" and
ondragenter="window.event.returnValue=false" settings are added to get around
the defaults. Not sure if I'm overlooking the obvious or if I misunderstood
this. Any tips or alternate recommendations appreciated.

Thanks in advance,

Rich
--
Newsguy -- http://newsguy.com

Sep 28 '05 #1
4 6757
Don't rely on MS only characteristics.

They are here today. They are gone tommorrow.

---------------------------------------


<ri**@newsguy.com> wrote in message news:dh********@drn.newsguy.com...
Hi,

Been trying to work through a simple drag and drop interface using either IMG, SPAN or DIV tags. That way I can define blocks of text and/or graphics as
draggable and be able to drop them on a similar (img, div, span, etc.) target, preferably an image.

I can highlight text from an "<input type=text>" field and reach a target to trigger an event (e.g. alert();), but can't get the same response when the
dragged item is a block of text or an graphic and drop it on either of the same targets.

Example Page: http://web.newsguy.com/fp2000/testdnd.html

The Microsoft site mentioned that the onDrop event has some default
characteristics that limit the dragged object to an input field, but other tags can be used if the "ondragover="window.event.returnValue=false" and
ondragenter="window.event.returnValue=false" settings are added to get around the defaults. Not sure if I'm overlooking the obvious or if I misunderstood this. Any tips or alternate recommendations appreciated.

Thanks in advance,

Rich
--
Newsguy -- http://newsguy.com


Sep 29 '05 #2
In article <sk********************@tornado.tampabay.rr.com> , commercial says...

Don't rely on MS only characteristics.

They are here today. They are gone tommorrow.

Actually tested the code across a number of browsers. I can setup drag and drop
so a selected item moves around a web page on different web browsers (e.g. FF,
Safari, IE). If the non-MS browsers are able to drag an item around a web page
just as IE does, it would seem useless to have that available unless javascript
had the "onDrop" functionality to trigger something when the drag is done.

Maybe I'm taking the wrong approach to this. Anyone heard of a way to simulate
drag and drop, maybe with a combination of onMouse... events, that can be used
as an alternative. Certainly wouldn't want to limit its usefulness to IE.

Thanks,
Rich
--
Newsguy -- http://newsguy.com


---------------------------------------


<ri**@newsguy.com> wrote in message news:dh********@drn.newsguy.com...
Hi,

Been trying to work through a simple drag and drop interface using either

IMG,
SPAN or DIV tags. That way I can define blocks of text and/or graphics as
draggable and be able to drop them on a similar (img, div, span, etc.)

target,
preferably an image.

I can highlight text from an "<input type=text>" field and reach a target

to
trigger an event (e.g. alert();), but can't get the same response when the
dragged item is a block of text or an graphic and drop it on either of the

same
targets.

Example Page: http://web.newsguy.com/fp2000/testdnd.html

The Microsoft site mentioned that the onDrop event has some default
characteristics that limit the dragged object to an input field, but other

tags
can be used if the "ondragover="window.event.returnValue=false" and
ondragenter="window.event.returnValue=false" settings are added to get

around
the defaults. Not sure if I'm overlooking the obvious or if I

misunderstood
this. Any tips or alternate recommendations appreciated.

Thanks in advance,

Rich
--
Newsguy -- http://newsguy.com


Sep 29 '05 #3
commercial said the following on 9/29/2005 4:11 AM:
Don't rely on MS only characteristics.
Half true.
They are here today. They are gone tommorrow.


Totally false.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 29 '05 #4
ri**@newsguy.com wrote:
In article <sk********************@tornado.tampabay.rr.com> , commercial says...
Don't rely on MS only characteristics.

They are here today. They are gone tommorrow.
Actually tested the code across a number of browsers. I can setup drag and drop
so a selected item moves around a web page on different web browsers (e.g. FF,
Safari, IE). If the non-MS browsers are able to drag an item around a web page
just as IE does, it would seem useless to have that available unless javascript
had the "onDrop" functionality to trigger something when the drag is done.


I think you mean that the DOM should have a 'drop' event. But anyway,
it doesn't. I guess ondrop has been implemented by some browser vendors
in order to provide that functionality, but non-standards stuff is
generally more inconsistent than standards-based stuff (innerHTML
springs to mind).

DOM 2 events:
<URL:http://www.w3.org/TR/DOM-Level-2-Events/events.html>

DOM 3 events:
<URL:http://www.w3.org/TR/DOM-Level-3-Events/events.html>

Maybe I'm taking the wrong approach to this. Anyone heard of a way to simulate
drag and drop, maybe with a combination of onMouse... events, that can be used
as an alternative. Certainly wouldn't want to limit its usefulness to IE.


Yes, using a combination of other events. There is some stuff at the
link below that may be useful:

<URL:http://www.walterzorn.com/dragdrop/dragdrop_e.htm>

[...]
--
Rob
Sep 30 '05 #5

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

Similar topics

4
by: Pai | last post by:
hello there, I am trying to rersize the window it works find in IE but doea not work with mozilla window.attachEvent(onload,MWSOnLoad); window.onload = function (MWSOnLoad) { alert('hello');...
13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
2
by: Ian Taite | last post by:
Hello All, ASP.NET has stopped working on my development server. I've read the various posts re this subject, but my circumstances seem unique. I need to know what causes the problem and how to...
4
by: TS | last post by:
I am creating a User control and i create some dynamic controls in the init handler. one of the controls is a custom validator which i assign a serverValidate event handler. I usally always do my...
14
by: TS | last post by:
I have this custom data list control and i override the onItemDatabound event. After upgrading to vs 2005, this event is not always getting called, though it does at other times. No changes were...
11
by: J055 | last post by:
Hi I have a dropdown control which is constructed in another dropdown control SelectedIndexChanged event protected void ddlParamType_SelectedIndexChanged(object sender, EventArgs e) { //...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
4
by: suzanne.boyle | last post by:
Hi, I'm adding an ImageButton as a child to a custom web control and attaching an event handler to it. When the page posts back the event is not being fired however. I initially assumed I had...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.