You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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('');
});
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: