Re: How to turn this into a REGEX for use in javascript?

2007-03-10 Thread Peter Boughton
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

Re: How to turn this into a REGEX for use in javascript?

2007-03-10 Thread Dinner
You could even put the below in the onchange, so the user knows what's gonna happen ahead of time. Assuming the below works. ;-) On 3/10/07, Peter Boughton wrote: Odd way of doing things? I'd switch it to something like this: cfif NOT REFind('[^0-9.$,]', Form.Sale_Price) /cfif

RE: How to turn this into a REGEX for use in javascript?

2007-03-10 Thread Rick Faircloth
I'm going to be using this regex in a validation plug-in that works with jQuery. I've got the plug-in working, I just need to add some additional validation statements. Is a JS statement that checks to see if an entry is in US dollars? That would be the simplest thing to use... because, really,

RE: How to turn this into a REGEX for use in javascript?

2007-03-10 Thread Rick Faircloth
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

Re: How to turn this into a REGEX for use in javascript?

2007-03-10 Thread Christopher Jordan
Rick, Here's a similar statement that I use in my own jQuery validation plug-in. It validates phone numbers saying basically, after stripping out all the parenthesis and dashes, if the remaining is numeric, then it's a good phone number... else if (ThisDataType == phone $this.val()

RE: How to turn this into a REGEX for use in javascript?

2007-03-10 Thread Rick Faircloth
Hi, Chris... Thanks for the example code. I searched for some info on the CFJS library, but didn't find anything. Is that something you wrote? Where can I find some info about it? Rick -Original Message- From: Christopher Jordan [mailto:[EMAIL PROTECTED] Sent: Saturday, March 10,

Re: How to turn this into a REGEX for use in javascript?

2007-03-10 Thread Peter Boughton
-- Does your code ... ? Yup. -- If so, that would do the same thing. Well it achieves the same result, but I would guess that just REFind is more efficient than IsNumeric+REReplace. -- Also, is that, then, what your JS version is doing? Yup, variable.match(/.../) is the equivalent to

RE: How to turn this into a REGEX for use in javascript?

2007-03-10 Thread Rick Faircloth
Thanks, Peter... I figured it was doing the same thing and was probably a matter of efficiency. Now I'll see if I can figure out how to put your JS code into the jQuery Validation plug-in I'm using. This is my first attempt at validation using JS... I've been doing it with CF, which works fine,