Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to show copy, cut and pase action on website

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 286
    Comment on it

    Hello Reader if you looking for any script that makes user a notification whenever he cut, copy of paste data from your website then you can see how it is done below:-

    This is the html page

    <body>
      <h1>jQuery copy, paste and cut example</h1>
      <form action="#">
          <label>TextBox : </label>
        <input id="textA" type="text" size="50" 
              value="Copy, paste or cut message here" />
      </form>
    
      <span></span>
    
    
    </body>
    

    Now the JS file for the validation will be go like this:-

    $("#textA").bind('copy', function() {
        $('span').text('copy behaviour detected!')
    });    
    $("#textA").bind('paste', function() {
        $('span').text('paste behaviour detected!')
    });    
    $("#textA").bind('cut', function() {
        $('span').text('cut behaviour detected!')
    });
    $(document).ready(function() {
    
        $("#textA").bind({
            copy : function(){
                $('span').text('copy behaviour detected!');
            },
            paste : function(){
                $('span').text('paste behaviour detected!');
            },
            cut : function(){
                $('span').text('cut behaviour detected!');
            }
        });
    
    });
    

    The css file:-

    span{
            color:blue;
        }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: