My textBox some times does not allow me to paste, it works for 5 or 6th attempt, sometimes in the very first attempt. I happens to me both in Crome and IE, below is the code
function AlphaNumericPaste() {
var objTxtBox = window.event.srcElement;
var num_regex = /^[\w]+$/;
var PasteData = TrimclipboardData();
if (!num_regex.test(PasteData)) {
CancelEvent();
}
}

Nigel FernandesRank #753 · 3.1K reputationPosted Feb 13, 2019, 2:33 PM EST
Puneet KankarRank #446 · 5.6K reputationPosted Feb 13, 2019, 5:34 PM EST
Mansoor Mohammed122 reputationPosted Feb 14, 2019, 3:13 AM EST
Muthu KumarRank #935 · 2.2K reputationPosted Feb 18, 2019, 10:33 PM EST
Reference:-
https://www.lucidchart.com/techblog/2014/12/02/definitive-guide-copying-pasting-javascript/
https://css-tricks.com/copy-paste-the-web/
https://stackoverflow.com/questions/686995/catch-paste-input