To Disable cut, copy and paste in Textbox in javascript
12 Comments so far
Leave a comment
November 3, 2008, 10:38 am
Filed under: JavaScript | Tags: Copy, Cut, Disable, JavaScript, oncopy, oncuty, onpaste, Paste, Propert, Textbox
Filed under: JavaScript | Tags: Copy, Cut, Disable, JavaScript, oncopy, oncuty, onpaste, Paste, Propert, Textbox
Javascript provides facility to disable cut, copy and paste from a particular textbox, properties are ‘oncopy’,'onpaste’ and ‘oncut’.It is for IE only. For Example:-
<asp:TextBox ID=”TextBox1″ runat=”server” oncopy=”return false” onpaste=”return false” oncut=”return false”></asp:TextBox>
Advertisement
12 Comments so far
Leave a comment
nice post sir..
Comment by Kaifi November 18, 2008 @ 7:47 amit’s nice .but i need to disable paste in to HTML Textbox
Comment by mahidhar November 28, 2008 @ 6:12 amif u want to disable copy, paste in html control just try following :
Comment by eanirudh November 28, 2008 @ 6:33 amonCopy=”return false”
onPaste=”return false”
Thanks for posting it…
i also learn other programming tips in this website..
http://www.techronnati.com
Comment by TechEvangelist December 9, 2008 @ 1:08 pmHi, it is working but options are not disabled. basically it is misguiding…
Comment by sanjay sahani December 22, 2008 @ 12:12 pmhi sanjay sahani, thanks for visiting my blog, as i have written, that this will work on IE only
Comment by eanirudh December 23, 2008 @ 5:20 amNot work in FF.
Comment by Rajesh Patel December 29, 2008 @ 7:57 ami know, thats why i have wrote only for IE
Comment by eanirudh December 29, 2008 @ 10:34 amIt works in IE, Firefox and Chrome.
Comment by Melonheadj44 July 15, 2009 @ 6:25 pmnt working in chrome n mozilla
Comment by ragini November 25, 2009 @ 10:12 amGud One !
Comment by Raj December 13, 2010 @ 7:38 amhi, nice sense of english
Comment by eanirudh December 18, 2008 @ 1:10 pm