Forum : How to test for bad numbers using JavaScript?
Brief description  about Online courses   join in Online courses
View Manju  S Reddy 's Profile

How to test for bad numbers using JavaScript?

How to test for bad numbers using JavaScript?
Asked by Manju S Reddy | Mar 22, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Manjunath,
the global method, "isNaN()" can tell if a number has gone bad.
var temperature = parseFloat(myTemperatureWidget.value);
if(!isNaN(temperature)) {
alert("Please enter a valid temperature.");
}
Mar 22, 2010