When using parseInt, make sure to specify the radix component (usually, you want base 
10).

----- Original Message -----
From: "S. Isaac Dealey" <[EMAIL PROTECTED]>
Date: Thursday, October 31, 2002 10:30 am
Subject: Re: OT js value validation

> > document.editExemptions.SCEPTempExemptUnits.value >
> > document.editExemptions.totalUnits.value
> 
> > I pass in SCEPTempExemptUnits as 2 and  totalUnits as 16... Why 
> would this
> > think that 2 is greater than 16?  It works if I pass in
> > SCEPTempExemptUnits
> > as 1 or 10..  Any ideas?
> 
> Probably because it's alphabetizing the values vs. a numeric 
> comparison --
> JavaScript doesn't know intuitively that the value in a text field is
> numeric, so you have to tell it that.
> 
> parseInt(document.editExemptions.SCEPTempExemptUnits.value) >
> parseInt(document.editExemptions.totalUnits.value)
> 
> ought to give you the results you're expecting.
> 
> S. Isaac Dealey
> Certified Advanced ColdFusion 5 Developer
> 
> www.turnkey.to
> 954-776-0046
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to