Home > .Net | Javascript > Disable copy paste in textbox asp.net

Disable copy paste in textbox asp.net

<asp:TextBox ID=”txtEmailAddress2″ runat=”server” MaxLength=”50″ oncut=”return false;” onpaste=”return false;” oncopy=”return false;” onkeydown=”return disableCtrlKeyCombination(event);”></asp:TextBox>

<script type=”text/javascript”>

function disableCtrlKeyCombination(e) {

key = e.which;     //firefox

if (e.ctrlKey) {

return false;

}

}

</script>

Comments are closed.

TOP