Skip to main content
January 5, 2007
Question

cfform passes integer validation , fails on data insert

  • January 5, 2007
  • 2 replies
  • 673 views
Hi,

I'm having some errors popping up on a site, in which users have to fill out a form where there is an input field for specifying quantity. If someone puts in 1,500 then the form submits without problems, because the validate="integer" passes. (Commas supposedly are allowed in integers). However, the database insert query fails, because <cfqueryparam cfsqltype="integer"...> doesn't pass.

This seems quite inconsistent... why would CF allow integers with commas in form validation, but not allow integers with commas in the cfsqltype parameter?

Does anyone know how I can work-around this?

Thanks,
Margaret
This topic has been closed for replies.

2 replies

jyotiyadav3
Participant
April 5, 2018

Hi Geokid,

If you are still facing the issue, you can use an alert function for that field and validate only for numbers, no other characters allowed.

Thanks,

Jyoti

WolfShade
Legend
April 19, 2018

I was going to say "Don't use CFFORM", then noticed that this originally posted in 2007.

^ _ ^

Inspiring
January 5, 2007
geokid wrote:
> This seems quite inconsistent... why would CF allow integers with commas in
> form validation, but not allow integers with commas in the cfsqltype parameter?

two different things actually, what a db will/won't accept isn't really up to cf
or the db driver writers (3rd party).

> Does anyone know how I can work-around this?

serverside, use the replace function to strip out any ",".