From 55b16b00f446cb179d3ee5c5c9b838f4e0de4ecc Mon Sep 17 00:00:00 2001 From: Dan Hansen <mokker1234@gmail.com> Date: Sun, 12 Dec 2010 01:09:47 -0500 Subject: [PATCH] Firefox sends charCode 0 when backspace is pressed --- public/javascripts/validation.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/javascripts/validation.js b/public/javascripts/validation.js index 0a72794443..d456bce49a 100644 --- a/public/javascripts/validation.js +++ b/public/javascripts/validation.js @@ -11,6 +11,7 @@ var Validation = { }, events: { usernameKeypress: function(evt) { + if(evt.charCode === 0) { return; } if(!Validation.rules.username.characters.test(this.value + String.fromCharCode(evt.charCode))) { evt.preventDefault(); } -- GitLab