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

why does validate="integer" accept commas?

New Here ,
Sep 21, 2015 Sep 21, 2015

Copy link to clipboard

Copied

Earlier versions of CF didn't let a comma slip through to mess up SQL statements.  This version does.  Not only that, but the javascript code in cfform.js, if extracted and run separately against a <form..>..</form> rather than a <cfform..>..</cfform> does trap and reject commas.  By the way this is true of validate="date", and validate="float" also.  I submitted a bug report on 9/14/15 and have had no response so far.  I notice that there were reports of this on this forum back in 2014.  Any thoughts other than abandon cfform?

Views

283

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 Expert ,
Sep 21, 2015 Sep 21, 2015

Copy link to clipboard

Copied

Would it help to set a new locale at he top of the page? For example, The English have 2.0, but the Dutch have 2,0.

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 ,
Sep 22, 2015 Sep 22, 2015

Copy link to clipboard

Copied

LATEST

SRolly wrote:

Any thoughts other than abandon cfform?

There was a time, a while ago, where CFFORM was kind of neat.  I used it a few times for generating Flash forms (mostly for security, ironically.)  Now, Flash is either dead, or dying; no point, now.

But, IMHO, these days CFFORM should never be used (those who disagree, hold your hate mail.)

I never liked the built-in "validation" of cfinput, etc.  I've always built validation from scratch (client- AND server-side) that gives so much more granular control.  So, if that's the reason you're using CFFORM, please do yourself a favor and learn basic validation (preferably server-side; client-side is nice, but can't be relied upon.)  You can use Regular Expressions to validate integer, float, etc.

HTH,

^_^

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