5

I am using Jquery to check to see if something isNumeric. How do I check to see if it is not numeric?

    if  (IsNumeric($('#Amount').val())) { .....

I put a ! before IsNumeric but that did not work.

2
  • isNaN($('#Amount').val()))? Commented Dec 28, 2011 at 21:26
  • $.isNan got removed in 1.7 I believe, in favor of $.isNumeric. Commented Dec 29, 2011 at 3:28

1 Answer 1

16

Your call to the function is a little off. It should be jQuery.isNumeric() or $.isNumeric(), so your code would look this:

if(!$.isNumeric($('#Amount').val())) {
   // do something
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.