Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery IsNumeric with a not condition

Tags:

jquery

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.

like image 719
Nate Pet Avatar asked Dec 28 '11 20:12

Nate Pet


1 Answers

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
}
like image 105
Interrobang Avatar answered Oct 13 '22 21:10

Interrobang