I have a text box with an id of EmpNum. I cannot figure out how to use jQuery's isNumeric to check to see if the value is numeric or not.
I tried:
('#.EmpNum').IsNumeric
but that did not work.
The isNumeric() method in jQuery is used to determine whether the passed argument is a numeric value or not. The isNumeric() method returns a Boolean value. If the given argument is a numeric value, the method returns true; otherwise, it returns false. This method is helpful as it decreases the lines of code.
The $. isNumeric() method checks whether its argument represents a numeric value. If so, it returns true . Otherwise it returns false .
The ISNUMERIC() function tests whether an expression is numeric. This function returns 1 if the expression is numeric, otherwise it returns 0.
according to http://api.jquery.com/jQuery.isNumeric/
it's :jQuery.isNumeric(value)
so, it should be $.isNumeric($("#EmpNum").val())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With