In my project i have text field that only take numeric value.but when I copy an alphabets using ctl+c and paste using ctl+v it will allow the alphabets in the text field.So I disable the the copy and paste using the following code.
$('input').bind('copy paste', function(e) {
e.preventDefault();
});
But I want to prevent only alphabets.That means I want copy paste numeric value not alphabets.
Try this function. This may not be what you are looking for but you can do something out of this. I have done this earlier and posted on my blog.
JS:
HTML:
This will allow you to enter only numeric values only. You can’t even copy paste and drag drop.
DEMO
Code Link