In this blog we will learn how to disable cut, copy, paste, and drop in a form, using jQuery.
<html> <head> <title>Nikhil Sangani</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script type="text/javascript"> $(function () { var inputarea = $("#Informationform :input"); inputarea.bind("cut", function () { return false; }); inputarea.bind("copy", function () { return false; }); inputarea.bind("paste", function () { return false; }); inputarea.bind("drop", function () { return false; }); }); </script> </head> <body> <div id="Informationform"> <div> <span>First Name :</span> <input type="text" id="txtFname" /> </div> <div> <span>Last Name :</span> <input type="text" id="txtLname" /> </div> <div> <span>Emailid :</span> <input type="text" id="txtemailid" /> </div> <div> <span>Mobile No. :</span> <input type="text" id="txtmobileno" /> </div> </div> </body> </html>
Comments
Post a Comment