There is a simple form with checking numeric data through a regular expression through the following function:
function filterFloat (value) { var floatTemplate = /^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/; if( floatTemplate.test(value) ){ return Number(value); } alert ('Неверное значение!'); } When you try to send a zero, nothing happens at all - how to fix it?
0correctly and returns the number zero. Perhaps you continue to check incorrectly built. - VismanfilterFloat(0) === 0- will betrue. So the error is most likely wherefilterFloatisfilterFloat. - saaaaaaaaasha