Firefox sends charCode 0 when backspace is pressed
This commit is contained in:
parent
52a3996ad0
commit
55b16b00f4
1 changed files with 1 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ var Validation = {
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
usernameKeypress: function(evt) {
|
usernameKeypress: function(evt) {
|
||||||
|
if(evt.charCode === 0) { return; }
|
||||||
if(!Validation.rules.username.characters.test(this.value + String.fromCharCode(evt.charCode))) {
|
if(!Validation.rules.username.characters.test(this.value + String.fromCharCode(evt.charCode))) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue