you can use the following function to check whether any JavaScript value is a valid number :
var isNumeric = function(nr){ return ( (typeof (nr) === typeof(1)) && (null !== nr) && isFinite(nr)); }