-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I've noticed there is no check on pasting code which would be handy.
So I've added this piece of code below the keypress function:
// On paste we have to validate against the mask as well.
$(this).bind('paste', function(e) {
var part1 = this.value.substring(0,this.selectionStart);
var part2 = this.value.substring(this.selectionEnd,this.value.length);
if (!mask.test(part1 + String.fromCharCode(event.charCode) + part2))
$(this).val('');
});
Metadata
Metadata
Assignees
Labels
No labels