What seems to have covered all the bases in
my situation is to run two error traps:

Not Len(Trim(Form.Amount))

        - Catches empty formfields

Len(Trim(Form.Ammount)) and Not IsNumeric(REReplace(Form.Premium,
"[.$,]","","All"))>

        - This code makes sure there is data in the field
        - Allows for $ , . to be entered, but stripped out.  This is important
          because many times for dollar amounts, those characters are used
          and should not trigger an error for the user
        - Catches data entered into the field which is just a garbage entry,
          such as oweinfe9, does not assign it a value as using VAL would,
          but doesn't accept this garbage entry by stripping out all the
non-numeric
          characters and turning the entry into $9.00, for example
        - It would catch the entry as incorrect, redisplay the entry in the
formfield
          for the user to inspect and allow changes
        - By using this line of code, I can also redisplay the entry in
DollarFormat
          for the user, then have the $., stripped back out by this line for
processing

Those two trapping statements seems to cover all the bases, but it's hard to
anticipate everything someone might throw in a formfield.

Rick


> -----Original Message-----
> From: Eric Roberts [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 11:29 PM
> To: CF-Talk
> Subject: RE: Ok, I give...how can I do this...
>
>
> Numberformat(number,".99") worked for my problem.  Unless you specify a
> comma, numberformat will not put one in (with the exception of if
> you do not
> put in a mask).  I didn't realize that decimalformat outputs a
> string value
> (that's what I get for not reading the manual hehehehe)
>
> Eric
>
> -----Original Message-----
> From: Dawson, Michael [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 07 March 2006 08:23
> To: CF-Talk
> Subject: RE: Ok, I give...how can I do this...
>
> I would use a regular expression to remove *all* non-numeric characters.
> Then, check to see if the remainder is numeric.  You could do this both on
> the client and the server.
>
> M!ke
>
> -----Original Message-----
> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 06, 2006 7:16 PM
> To: CF-Talk
> Subject: RE: Ok, I give...how can I do this...
>
> Thanks for the tip, Josh...yet another way I'll have to validate an entry.
> Maybe it's just easier to let them make an illegal entry, then
> tell them how
> I want them to enter the data than try to catch all the possible
> violations...
>
> I wonder what will happen if they enter
> $1,000 and I run it against
> IsNumeric(Replace(Form.Dollars, ",","","all")) ?
> What about that dollar sign?
>
> I'll have to see...thanks, Josh...
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234598
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

Reply via email to