Re: How do I make these into a real type?
[ Follow Ups ] [ Post Followup ] [ Intranet eXchange ] [ IDM Home ]
Posted by Jon Hanlon on August 27, 2000 at 18:3:45:
In Reply to: Re: How do I make these into a real type? posted by Chris Davies on August 25, 2000 at 7:6:6:
Waddayamean "Your type checking routine doesn't work"?! It wasn't meant to be a cut-and-paste library routine, but rather a hint on what to do. parseFloat won't fail on an Aplha number, but it also won't fail on garbage like: parseFloat(22.33.44.55); // returns 22.33 parseFloat(3.5penguin); //returns 3.5 The problem with the validate routine you supplied is that if you add characters like "+-." to your 'valid' variable, then it's going to allow rubbish like "3.+8383-87..48"
Follow Ups:
|