hello, i am searching for a way to disable copy and paste from my form using javascrip. i dont want the user to be able to past anything to the form or copying anything. help please.
+2
A:
You will be modifying the way the user expects basic functionality to work. Why do you not want them to copy or paste anything? I heavily advise against building that into your solution.
Also have you thought about people with Javascript disabled?
Tom Gullen
2010-08-26 10:36:29
no nothing would be change .. but i dont want the users to paste data into the form that they are filling or for example if there is confirm your email box dont want them to be able to copy this information from the first txtbox and paste in the second
Mohamed23
2010-08-26 10:39:00
That is just silly, think about how many sites manage without such limitations in their registration forms.
adamse
2010-08-26 10:42:42
The confirm email box really grates me, because you can see what you type. It makes sense for passwords, because you can't see what you type. Also, think about why someone would copy + paste their email in, probably because they are 100% sure they entered it correctly the first time! I do this all the time. You are going to irritate a lot of users if you block that functionality.
Tom Gullen
2010-08-26 10:59:39
@Tom Gullen: Well put. I use a password manager/generator application for many of my passwords. This means that I have no idea what most of my passwords are, and there's no way I'm going to type in a 20-30 character long randomly generated password twice!
Mike
2010-08-26 11:55:05
A:
Just add these attributes to the textbox
ondragstart=”return false” onselectstart=”return false”
david99world
2010-08-26 10:39:00