SC.Validator.CreditCard not handling backspaces properly in IE #592

jmulieri opened this Issue Aug 30, 2011 · 0 comments


None yet
1 participant

The backspace key does not work in IE for fields using the credit card validator. I changed SC.Validator.CreditCard.validateKeyDown function to get it to work:

validateKeyDown: function(form, field, charStr) {
return (charStr.charCodeAt(0) == 0 || !!charStr.match(/[0-9- ]/));

I also saw that backspace is getting mapped to code 0 in SC.Event.getCharString which causes SC.Validatable.performValidateKeyDown to miss the null check. I wasn't sure what the correct relationship was, so just passing along the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment