Mohamed23
Mohamed23

Reputation: 33

Disabeling Copy/paste from my form using java script

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.

Upvotes: 0

Views: 288

Answers (2)

David
David

Reputation: 20073

Just add these attributes to the textbox

ondragstart=”return false” onselectstart=”return false”

Upvotes: 0

Tom Gullen
Tom Gullen

Reputation: 61775

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?

Upvotes: 3

Related Questions