I am currently working on a project where I need to check if the user input a number value. The problem comes when he input a number starting with a decimal point (.20
). I've been looking for a solution, but now I just give up. Neither isNaN or isNumeric works. Also tried to check like: if(value > 0)
, but this only works when the user input a leading zero.
Any help would be greatly appreciated! Thanks in advance!
SOLVED: isNaN doesn't work for me because I use parseInt() instead of parseFloat(). Now everything works just fine. I want the administrators to excuse me for the dumb question I asked! This thread could now be deleted.