• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfform passes integer validation , fails on data insert

Guest
Jan 04, 2007 Jan 04, 2007

Copy link to clipboard

Copied

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
TOPICS
Database access

Views

639

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 05, 2007 Jan 05, 2007

Copy link to clipboard

Copied

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 ",".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 04, 2018 Apr 04, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 19, 2018 Apr 19, 2018

Copy link to clipboard

Copied

LATEST

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

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation