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();
}
}
Muthu KumarPosted Feb 19, 2019, 3:33 AM
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
Mansoor MohammedPosted Feb 14, 2019, 8:13 AM
Puneet KankarPosted Feb 13, 2019, 10:34 PM
Nigel FernandesPosted Feb 13, 2019, 7:33 PM