I’m using htmlarea for my little CMS, and I was wondering if it’s possible to detect if something gets pasted into it with jQuery?
Share
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.
Try adding an Event Listener to your textarea for “keydown,”
and then looking out for keyCode == 86, that’s the paste event.
Now you can do whatever you want to happen when a user tries to paste.
Like this:
I hope that helps.