That one is telling me that an empty string is numeric.
Now, even if there is no easier way to do it, you could try this out:
[php]function isNumeric(sText)
{
var ValidChars = "0123456789.";
if(sText==null || sText.length==0) return false;
for (i = 0; i < sText.length; i++)
{
if (ValidChars.indexOf(sText.charAt(i)) == -1)
return false;
}
return true;
}[/php]
Faster + more compact if not more correct too.
You may like to check too if there is '-' or '+' on the start and as well if '.' occurs only once in the string. Currently it accepts strings like '1232.32131.1232'. Scientific form? (1.23e-10)
Have you heard for RegExp btw?