JavaScript Function isNaN

Small JavaScript function to check if a variable is a number.

function checkValue(value){
  if(isNaN(value)){
    return false;
  }else{
    return true;
  }
}

Use this in your form validation if you are checking to see that a user has entered a number.

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
1 + 18 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.