Hi, Peter...

What my REReplace is doing is saying that
if, after taking out any periods, dollar signs, or commas,
the resulting entry is not numeric, then the entry is wrong.

If the entry only has digits, periods, dollars signs, or commas,
(I guess I'm hoping in the right places), then the entry can be
parsed with LSParseCurrency before inserting into a database.

Does your code "REFind('[^0-9.$,]', Form.Sale_Price" state that
if anything besides digits 0-9 and periods, dollar signs, and commas
are found in the entry it's invalid?  If so, that would do the same thing.

Also, is that, then, what your JS version is doing?  Checking to make
sure there's nothing but digits 0-9, periods, dollar signs, and commas
in the entry?

Thanks for the help...

Rick

-----Original Message-----
From: Peter Boughton [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 10, 2007 2:22 PM
To: CF-Talk
Subject: Re: How to turn this into a REGEX for use in javascript?

Odd way of doing things?

I'd switch it to something like this:
<cfif NOT REFind('[^0-9.$,]', Form.Sale_Price)>
.....
</cfif>

Which (I think) can be translated into this JS:
if (sale_price.match(/[^0-9.$,]/) == false)
{
.....
}



>Hi, all.
>
>I've been tinkering with validation using js and would
>like to know how to turn this into a regex for use in js:
>
>Is Numeric (REReplace(Form.Sale_Price, "[.$,]","","All"))
>
>Any help available?
>
>Thanks,
>
>Rick





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272283
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to