tracker issue : CF-4055832

select a category, or use search below
(searches all categories and all time range)
Title:

Integer and Float validation passes input commas

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Stephen Brown / Stephen Brown (Stephen Brown)

Created: 09/14/2015

Components: CFForm

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 0

Listed in the version 2016.0.03.300466 Issues Fixed doc
On html input forms using <cfform..> and validate="integer" or validate="float" I find that inputting a comma into the field isn't trapped so an error is thrown when the form is submitted and the input value passed to an sql update statement

I have several <cfform..> templates, they all behave the same

I see no workarounds for this other than creating my own validation code.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4055832

External Customer Info:
External Company:  
External Customer Name: Stephen Brown
External Customer Email:  
External Test Config: Dell Latitude E6540 running Windows 7 Pro, MSSQL server 12, and Cold Fusion 11

Attachments:

  1. September 16, 2015 00:00:00: 1_JSsubmit.cfm
  2. September 16, 2015 00:00:00: 2_JSdebug.cfm
  3. August 19, 2016 00:00:00: 3_JSsubmit.cfm
  4. August 19, 2016 00:00:00: 4_JSdebug4.cfm
  5. August 19, 2016 00:00:00: 5_MyJS.cfm

Comments:

This same code runs without error under CF MX7. I first encountered this bug with validate="date" and resolved it by using the mask feature. This seems an obvious and easily-corrected bug.
Comment by External U.
5895 | September 14, 2015 03:18:07 PM GMT
I copied the javascript code from my old version of CF (studio 4) into a web page on my Win 7 Pro 64 bit machine and was able to use it for number checking. What this says to me is that it's not something wrong with the javascript interpreter in Firefox, but something with the javascript .js file accessed by CF 11 when generating an input form that utilizes <cfform..> and validate="float".
Comment by External U.
5896 | September 15, 2015 05:35:25 PM GMT
I've attached the two .cfm files that illustrate how the old validation javascript performs numeric validation without a problem. I modified the code slightly to fit it into a simple form, and used <form..> rather than <cfform..> to avoid CF imbedding its own validation code.
Comment by External U.
5897 | September 15, 2015 05:39:24 PM GMT
Low priority?! My users are not happy! Fix this! I've tested the individual cf functions in the cfform.js file separately. They work. However something goes wrong when cfform.js is called as a js source. Entering a comma rather than a decimal point is a relatively common error, not some out in the boondocks crazy event! Low priority my ...! Oh, the date validation has the same error!
Comment by External U.
5898 | September 18, 2015 05:09:46 PM GMT
DJ, can you check this ? I am not sure what path to put in build.xml for cfform-src.js file which also needs to be compressed
Comment by Uday O.
5899 | August 10, 2016 12:58:33 AM GMT
Well...is someone finally going to look at this and at the two templates I attached 11 months ago? I hope so.
Comment by External U.
5900 | August 10, 2016 02:57:17 PM GMT
I've attached 3 .cfm files, MyJS.cfm, JSdebug4.cfm, and a new version of JSsubmit.cfm to better illustrate the problem. Please run them, opening with JSdebug4.cfm, to see what I'm getting at. Thanks
Comment by External U.
5901 | August 18, 2016 12:52:30 PM GMT