Computer Magic Logo
Prevent Cut, Copy and Paste Operations

Monday, June 12, 2017

Published by Aristotelis Pitaridis

The following example demonstrates how to prevent user from cutting, copying or pasting information for one or more inputs.

$(function () {
    $('#email').bind('cut copy paste', function (e) {
        alert('You cannot ' + e.type + ' text!');
        e.preventDefault();
    });
});