Env: jQuery, richfaces
We would like to disable copying (using CTRL+A) sensitive information on certain pages and pasting via the clipboard. We would rather expect the user to use few buttons to export the data. How do we achieve this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot. It is the user’s computer and they can copy any data that they can see.
Now you can annoy the hell out of them by having some JavaScript that intercepts keys like Control-A and Control-C, but I hate that so much that I’m not going to tell you how to do it. You can downvote me all you like!
I suppose a nice middle ground would be to detect when the user tries to copy and not disallow it, but display some kind of a message along the lines of “Hey, are you trying to export the data? Try the Export button over there ->”