Can you use isNaN here?
Just use it on your number to verify that it is or is not a number...
what's your code look like?
On Mon, 10 Jan 2005 14:43:27 -0500, DURETTE, STEVEN J (AIT)
<[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Need some help with a regex. What I'm trying to do is validate and
> input in javascript.
>
> The users are allowed to input a number.
>
> It can be in the following formats:
> 9
> 9.9
> 9.99
> .99
> .9
>
> (9 used inplace of any digit.)
>
> I tried using \b[0-9.]+ and I've tried \b[\d]*([.]?[\d]{0,2})? and I've
> tried ([\d]*([.][\d]{1,2})?){1} but I can't seem to get the response
> that I want.
>
> The user can still input numbers such as 1.25.25 and it will pass the
> regex test.
>
> To be more specific in what I'm looking for, the users are putting in
> hours and partial hours.
> There can be any amount of hours, but partial hours are limited to .0,
> .00,.25, .5, .50, .75 or no decimal part whatsoever. (I've been trying
> to do the .25, .5, etc in another part of the javascript, but if I can
> do it in the regex even better.)
>
> Anybody got any ideas.
>
> Thanks
> Steve
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189833
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54