Anirudh’s Weblog


To Disable cut, copy and paste in Textbox in javascript
November 3, 2008, 10:38 am
Filed under: JavaScript | Tags: , , , , , , , , ,

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

it’s nice .but i need to disable paste in to HTML Textbox

Comment by mahidhar

if u want to disable copy, paste in html control just try following :
onCopy=”return false”
onPaste=”return false”

Comment by eanirudh

Thanks for posting it…

i also learn other programming tips in this website..

http://www.techronnati.com

Comment by TechEvangelist

Hi, it is working but options are not disabled. basically it is misguiding…

Comment by sanjay sahani

hi sanjay sahani, thanks for visiting my blog, as i have written, that this will work on IE only

Comment by eanirudh

Not work in FF.

Comment by Rajesh Patel

i know, thats why i have wrote only for IE

Comment by eanirudh

It works in IE, Firefox and Chrome.

Comment by Melonheadj44

nt working in chrome n mozilla

Comment by ragini

Gud One !

Comment by Raj

hi, nice sense of english

Comment by eanirudh




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s



Follow

Get every new post delivered to your Inbox.