Я делаю некоторую маску ввода, которая допускает только число с плавающей запятой. Но текущая проблема заключается в том, что я не могу проверить, было ли введено несколько точек. Можете ли вы проверить эти точки и предотвратить это для меня?
Живой код: http://jsfiddle.net/thisizmonster/VRa6n/
$('.number').keypress(function(event) {
if (event.which != 46 && (event.which < 47 || event.which > 59))
{
event.preventDefault();
if ((event.which == 46) && ($(this).indexOf('.') != -1)) {
event.preventDefault();
}
}
});