aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery Disable Cut Copy Paste Options in Textbox

Apr 21, 2013

Here I will explain how to disable cut, copy and paste functionality for the Textbox using jQuery. In jQuery we can restrict to user to cut, copy, paste options in Textbox easily by using simple code.

To disable cut, copy and paste functionality for the Textbox we need to write the code like as shown below

<script type="text/javascript">
$(function() {
$('#txtName').bind("cut copy paste", function(e) {
If you want to see it in complete example write the code like as shown below

<html xmlns="">
<title>Disable Cut, Copy and Paste Options in textbox using jQuery</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(function() {
$('#txtName').bind("cut copy paste", function(e) {
<input type="text" id="txtName" />
Live Demo

For live demo try to enter text in textbox

Enter Text:

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


anupam suman said...

plz give some realtime example with solution on WCF it will help to prepare for interview .

Anonymous said...

i think its not working as i tried to do cut,copy with other textboxes in this page...same result i got...and when i selected text in the textbox...the cut and copy options were available...what is the code actually supposed to do?

Suresh Dasari said...

It's working fine. i have written code only for Live Demo Textbox not for all the textboxes in this page. Please test completly before post comments like not working...

Anonymous said...

Hi Suresh
How to add multiple text boxes to that function.
Could you please reply.

baresha ali said...

Helpful for me ...thank u

venky venkatesh said...

sir how to change this into control....

pls respond me

Anonymous said...

sir,I need explanation for the above code because i selected the text and gave right click and then i cut the data and again copied it there so cut,paste r working

Anonymous said...

Its working fine..@venky just do like this for asp controls..

$(function () {
$("#<%=TextBox10.ClientID %>").bind("cut copy paste", function (e) {

In the abouve 'TextBox10' is the id of asp textbox

Ashish arora said...

plz explain the above code

Give your Valuable Comments

Other Related Posts

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.