Hi Everyone!
I have working on asp.net login application using c#. I want to prevent copy and paste functionality in password textbox that support all latest browser!
Thank in advance!
Home / DeveloperSection / Forums / prevent copy past in textbox using jquery!
Hi Everyone!
I have working on asp.net login application using c#. I want to prevent copy and paste functionality in password textbox that support all latest browser!
Thank in advance!
AVADHESH PATEL
05-Mar-2013Hi Lois!
You can try this way!
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#txtProductQty").bind('copy paste', function (e) {
e.preventDefault();
});
$("#txtProductQty").val("1");
});
</script>
</head>
<body>
<input type="text" id="txtProductQty"/>
</body>
</html>