---
title: "prevent copy past in textbox using jquery!"  
description: "prevent copy past in textbox using jquery!"  
author: "Anonymous User"  
published: 2013-03-05  
updated: 2013-03-05  
canonical: https://www.mindstick.com/forum/623/prevent-copy-past-in-textbox-using-jquery  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# prevent copy past in textbox using jquery!

Hi Everyone!

I have working on [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) login [application using c#](https://www.mindstick.com/forum/160510/how-to-fetch-data-from-the-database-in-the-dot-net-console-application-using-c-sharp). I want to prevent [copy and paste](https://answers.mindstick.com/qa/95127/how-do-you-copy-and-paste-the-contents-of-a-pdf) [functionality](https://www.mindstick.com/blog/136/using-watermark-functionality-in-textbox-by-jquery) in [password](https://www.mindstick.com/blog/118/retriving-user-password-by-using-stored-procedure-in-asp-dot-net) [textbox](https://www.mindstick.com/forum/12714/dynamic-textbox-in-gridview) that [support](https://yourviews.mindstick.com/view/286/modi-support-for-sportsperson) all latest [browser](https://www.mindstick.com/blog/155254/which-is-the-best-internet-browser)!

Thank in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi 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>


---

Original Source: https://www.mindstick.com/forum/623/prevent-copy-past-in-textbox-using-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
