Solved

Disable Drag and Drop in Internet Explorer?

Posted on 2004-09-14
5
705 Views
Last Modified: 2008-03-04
Hello,


Is it possible to disable Drag and Drop in IE for user when he surfs the web page?

E.g. So the user is unable to drag an Image from one frame to another.

If this is not possible by scripting, how do I achieve otherwise ?

Regards,

M PG
0
Comment
Question by:morpheous_
  • 2
5 Comments
 
LVL 33

Accepted Solution

by:
sajuks earned 50 total points
ID: 12052636
//try this,
<body onDragStart="return false">
<img name="img" src="http://experts-exchange.com/images/indexLogo.gif">
</body>
0
 

Author Comment

by:morpheous_
ID: 12053017
This works if I don'tuse the frames the way I do.

I have three frames in my frameset:

frameTop.aspx (frameTop)
n/a  (frameMain)
frameBottom.aspx (frameBottom)

frameMain is passed to frameset as attribute and doesn't exist form the start,except is created
from attributed (?href=pageurl.xml) passed from previous page.

this is the way frameset looks like:

<frameset rows="120,*,40" frameborder="NO" border="0" framespacing="0">
  <frame src="frameTop.aspx" name="frameTop" scrolling="no" noresize>
  <frame src='<%=Request.QueryString["frameMain"]%>' name="frameMain" scrolling="no" noresize>
  <frame src="frameBottom.aspx" name="frameBottom" scrolling="no" noresize>
 </frameset>


So, this way I am unable to set <body onDragStart="return false"> on the frame file that desn't exist.

Is there a way to do this somehow, shut down drag and drop on whole client / IE?


Thanx in advance!

Michael P G
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12053416
try something like,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
var obj;
var dragging = false;
var objx, objy;


function cancelEvent()
{
   window.event.returnValue = false;
}

//-->
</SCRIPT>
</HEAD>

<BODY>
<img ondragstart="cancelEvent()" src="http://experts-exchange.com/images/indexLogo.gif">
</BODY>
</HTML>

//http://bucarotechelp.com/design/97110430.asp
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Placeholder text not disappearing in Contact Form 7 2 23
Javascript Form Change 5 31
Head to not include on scroll 4 23
JS Event Does not Trigger From File 2 26
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question