...................in javascript....................................
<input type="text" oncopy="return false" onpaste="return false" oncut="return false" />
--------------------------------------------------------------------------
...................in jquery....................................
<input type="text" id="txt" />
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(document).ready(function(e) {
$('#txt').bind('cut copy paste',function(e) {
e.preventDefault();
alert('not allow to do this...')
});
});
</script>
<input type="text" oncopy="return false" onpaste="return false" oncut="return false" />
--------------------------------------------------------------------------
...................in jquery....................................
<input type="text" id="txt" />
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(document).ready(function(e) {
$('#txt').bind('cut copy paste',function(e) {
e.preventDefault();
alert('not allow to do this...')
});
});
</script>
No comments:
Post a Comment