- To bind the event for the cut, copy and paste. Declare a function and make the event to prevent using ‘e.preventDefault();’.
- Then we can alert the user, this password textbox won’t allow cut, copy and paste.
//To Prevent the Cut, Copy, Paste in the Password.
$(document).ready(function () {
$('#<%=txtPassword.ClientID %>').bind('cut copy paste', function (e) {
e.preventDefault();
alert('Password is not allowed Cut-Copy Paste!');
});
});



0 comments:
Post a Comment