Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1182 Is there a way to disable the cut and copy function?

You are here: irt.org | FAQ | JavaScript | Event | Q1182 [ previous next ]

Try:

<head>

<script language="JavaScript1.1"><!--
function mouseup(e) {
    if (document.layers) {
        if (!window.find('Please do not cut and paste.',false,false))
            window.find('Please do not cut and paste.',false,true);
    }
    else if (document.all) {
        var rangeText = document.body.createTextRange();
        window.findText('Please do not cut and paste.');
    }

    return true;
}
document.onmouseup=mouseup;
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmouseup=mouseup;
//--></script>

</head>

<body>

<!-- place your content after this line -->

<p>
<img src="picture.gif" width="100" height="100">
</p>

<p>
some text
</p>

<p>
<a href="somewhere.htm">text link</a>
</p>

<!-- and before this line -->

<p>
Please do not cut and paste.
</p>

</body>
</html>

It is still possible to use CTRL+A (for marking all text) and then CTRL+C (for copying all marked text) and CTRL+V for pasting in Internet Explorer.

With Netscape Navigator, simply choose Edit, then Select All, and finally Copy.

Feedback on 'Q1182 Is there a way to disable the cut and copy function?'

©2018 Martin Webb