sgjjohns
09-10-2003, 08:32 AM
The following script will disable the ability to select text using either the mouse or "select all" menu function for IE 4+ and NS6+ browser versions. Unfortunately there is a problem with Netscape 4x. While it does prevent the selection of text using the mouse with 4x versions of Netscape, it does not prevent the selection of text using the "Select All" from the EDIT menu. I believe that it is possible to do this, but I have been unable to figure out how. Does anyone know how to disable SELECT ALL on the edit menu for Netscape 4x?
<script language="JavaScript1.2">
function disabletext(e){
return false
}
function reEnable(){
return true
}
//if the browser is IE4+
document.onselectstart=new Function ("return false")
//if the browser is NS6
if (window.sidebar){
document.onmousedown=disabletext
document.onclick=reEnable
}
</script>
<script language="JavaScript1.2">
function disabletext(e){
return false
}
function reEnable(){
return true
}
//if the browser is IE4+
document.onselectstart=new Function ("return false")
//if the browser is NS6
if (window.sidebar){
document.onmousedown=disabletext
document.onclick=reEnable
}
</script>