jQuery-Plugins
jQuery-Plugins copied to clipboard
Delete key not working on decimal numbers
In Firefox if the value in the text box already have a decimal point, then delete key is not working. But back space key will work.
But delete will work in IE and Chrome.
I have a work around for this:
Here is the code snippet I put:
if(key == decimal.charCodeAt(0)) {
if(!this.containsDecimal) {
allow = true;
this.containsDecimal = true;
} else {
if(key == 46) {
if(e.charCode == 0) return true;
if(this.containsDecimal) return false;
return true;
}
allow = false;
}
}