Re: Validating an amount with commas allowed

2005-04-07 Thread Wendy Smoak
From: Greg Pelly [EMAIL PROTECTED] Here's a better mask to use: var var-namemask/var-name var-value^\$?\d+(,\d{3})*(\.\d{2})?$/var-value /var This is *perfect*! Thanks also to Hubert for reminding me about 'mask' in the first place. :) -- Wendy Smoak

Re: Validating an amount with commas allowed

2005-04-06 Thread Hubert Rabago
I'm useless with regex. However, I found this on the web some time ago and seemed to match what I needed back then: var var-namemask/var-name var-value^(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d{1,2}){0,1}$/var-value /var This allows them to include the .00 if they so desire. hth, Hubert On

RE: Validating an amount with commas allowed

2005-04-06 Thread Greg Pelly
($1,500,200.99)) { alert ('matches'); } else { alert ('does not match'); } /script HTH, Greg -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 3:39 PM To: Struts Users Mailing List Subject: Re: Validating an amount with commas