[thelist] js validating numbers

Erik Mattheis gozz at gozz.com
Tue Feb 11 10:02:32 CST 2003


function isNumber(check) {
	return (!isNaN(chk));
	// true if any kind of number

On Tuesday, February 11, 2003, at 08:22  AM, Tom Dell'Aringa wrote:
> Hello,
> I am working on a form where I have to validate some fields to make
> sure the values entered are numeric. I have this function which does
> work:
> However, it looks like they want me to validate 2 types of numbers: 1
> - that its a number, and 2 - that its a *percent* (i.e., 5.76) or
> floating point. I'm not sure my function is sufficient for this
> second part..what do you think? Should they be forced to enter 2.00
> for 2%? How would I manage forcing a percentage?

Erik Mattheis
GoZz Digital
Flash and ColdFusion Development
Minneapolis, MN

More information about the thelist mailing list