Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
56
rated 0 times [  63] [ 7]  / answers: 1 / hits: 188219  / 13 Years ago, thu, june 23, 2011, 12:00:00

Possible Duplicate:

Validate numbers in JavaScript - IsNumeric()






var miscCharge = $(#miscCharge).val();


I want to check misCharge is number or not. Is there any method or easy way in jQuery or JavaScript to do this?



HTMl is



<g:textField name=miscCharge  id =miscCharge value= size=9 max=100000000000 min=0 />

More From » jquery

 Answers
11
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}

[#91559] Tuesday, June 21, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
turnerf

Total Points: 620
Total Questions: 101
Total Answers: 109

Location: French Polynesia
Member since Tue, Jul 7, 2020
4 Years ago
turnerf questions
;