Solved

disable ability to highlight text in ie

Posted on 2001-06-04
9
257 Views
Last Modified: 2008-03-06
Hi,

Does anyone know if there is a way to disable the user from highlighting text while using an instance of the ie?

Thanks ,
Chris
0
Comment
Question by:chrisshebib
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6156364
<SCRIPT LANGUAGE="JavaScript1.2"><!--
function disableSelect() {
   if (navigator.appName=="Netscape")
        window.find(' ');
   else if (navigator.appName == "Microsoft Internet Explorer")
        document.selection.empty();
   else
       return true;   // do something else if you want
    return false;
}

document.onMouseDown = disableSelect;
//--></SCRIPT>

HTH,
CJ
0
 

Author Comment

by:chrisshebib
ID: 6156892
CJ,

I tried this but it had no effect - I'm using IE 5.5 with SP1.

Here is the code that I'm testing with:

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
function disableSelect()
{  
     if (navigator.appName=="Netscape")      
     {
          window.find(' ');  
     }
     else if (navigator.appName == "Microsoft Internet Explorer")      
     {
          alert("MSIE");
          document.selection.empty();  
     }
     else      
     {
          return true;
     }
       
     // do something else if you want  
     return false;
}

document.onMouseDown = disableSelect;
//-->
</SCRIPT>

<body onload="disableSelect();">

<p>Here is some sample text</p>

</body>

</html>


Thanks,

Chris
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6157119
The code is supposed to work for NS4 and IE4.. I am not sure about IE 5.5
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:chrisshebib
ID: 6157232
Ok, thanks for you help anyway.

Chris
0
 

Author Comment

by:chrisshebib
ID: 6157306
Ok, thanks for you help anyway.

Chris
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
ID: 6157419
0
 

Author Comment

by:chrisshebib
ID: 6157500
Ah, that did the trick.
 
Thanks very much.

Chris
0
 

Author Comment

by:chrisshebib
ID: 6157570
Ah, that did the trick.
 
Thanks very much.

Chris
0
 

Author Comment

by:chrisshebib
ID: 6157572
That did the trick!

Thanks very much,
Chris
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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

635 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