View Single Post
  #2 (permalink)  
Old 03-13-2007, 05:35 PM
Tripy Tripy is offline
WMG Newcomer
 
Join Date: Mar 2007
Posts: 31
iTrader: (0)
Tripy is on a distinguished road
Default

What kind of validation. For it to be numeric only ?
Positive numeric only, or can it be negative too (like -20)

If it's strictly numeric, then isNan() is your friend.
Code:
var value=10;
var result=null;
//isNan() test if the parameter is NOT a number. So testing that a number is NOT not a number does the trick.
if(!isNan(value)){
  result=true;
}
else{
  result=false;
}
reference: http://docs.sun.com/source/816-6408-...ev.htm#1064024
Reply With Quote
Sponsored Links
Register and sign in to hide this ad block