I'm making an input that accepts only numbers, dots and commas; but for some reason, I can't make the input accept the commas and periods.
Code that currently does not work:
$('.numberType').keypress(function(key) {
if (key.charCode == 188 || key.charCode == 190) return true;
if (key.charCode < 48 || key.charCode > 57) return false;
})