New ColdFusion Error: Form Entries Incomplete Or Invalid

Posted June 12, 2007 at 10:06 AM

Tags: ColdFusion

I just got a ColdFusion error that I have never seen before:

Form entries incomplete or invalid. Please go back an correct the problem.

Here is the uber-useful ColdFusion error screen:


 
 
 

 
ColdFusion Form Field Validation Error  
 
 
 

This is about the most useless ColdFusion error ever! How could I even go about debugging this? They don't even give me a template or a line number or even what FORM value they might be talking about. I started commenting out all the code I had just put in until I narrowed it down to this code:

 Launch code in new window » Download code as text file »

  • <input
  • type="text"
  • name="usage_cap_time"
  • value="#FORM.usage_cap_time#"
  • />

Ahhh, then it hit me. TIME. This form field ends with the word "Time." This has to be one of ColdFusion's worst features every brought / kept into existence; because this form field ends with "time," ColdFusion will try to validate the form field "usage_cap" as being a valid time value.

Does anyone even use this ColdFusion validation style? How do you sleep at night :)

Download Code Snippet ZIP File

Post Comment  |  Ask Ben  |  Permalink  |  Print Page



Learning ColdFusion 9 - ColdFusion 9 tutorials, samples, examples, demos

Reader Comments

Jun 12, 2007 at 10:15 AM // reply »
45 Comments

It's not "time" - it's "_time"

Solution - use camelCase not underscores :)


Jun 12, 2007 at 10:17 AM // reply »
35 Comments

Yeah, there are a few of those that trigger the autovalidation. Like _required for example.

We should have asked for an application-wide setting to disable that 'feature'.

I haven't seen anyone actually use the convention validation, I have seen folks spend a lot of time trying to diagnose the resulting, and unintentional, error.

Put it in the same bucket as <cfinsert> and <cfupdate>


Jun 12, 2007 at 12:43 PM // reply »
1 Comments

Crazy! I didn't realize it would even do that for an INPUT tag. I thought it only matters if you use CFINPUT / CFFORM.


Jun 12, 2007 at 12:50 PM // reply »
6,516 Comments

Yeah it is crazy :) I think was left over from the days before any real validation was available or something. I think it is time that ColdFusion dumped this from its backwards-compatability.


Jun 12, 2007 at 12:52 PM // reply »
4 Comments

Yes and _required and _numeric have caught me in the past when just using the names that someone else used for data in the database!!

Took me hours to debug the first time. Now I warn all students who attend my calsses so that hopefully it won't get them too.


Dec 2, 2007 at 10:02 AM // reply »
2 Comments

Here's a funny couple ones, try _applied or _employed. Those seem to fail for me no matter what. I definitely agree that this is as dumb of a feature as building an application server on java (I have to restart it or close file handles just to modify .html files.) The development cycle of using coldfusion is hilarious compared to more professional solutions.


Dec 2, 2007 at 6:12 PM // reply »
6,516 Comments

@Xedecimal,

That is so crazy that those would fail. They don't even make sense (from a validation standpoint).


Dec 3, 2007 at 2:15 AM // reply »
2 Comments

I asked around for some kind of reference to a list of these 'dumb' names. It was suggested that they don't even have a list of them. I dug around for a while and found these urls...

http://www.chapter31.com/2007/04/24/unwanted-coldfusion-form-validation/
http://cfsilence.com/blog/client/index.cfm/2007/2/27/cfform-Server-Side-Validation-Gotcha
http://www.mischefamily.com/nathan/index.cfm/2007/7/21/ColdFusions-Serverside-Form-Validation
http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001385.htm

So this isn't the only place having a blast with this error. Maybe the new Adobe purchase of the good stuff as well as the bad stuff *cough*coldfusion*cough* will allow them to make it better, ha, ha ha, that's funny.


Dec 3, 2007 at 7:12 AM // reply »
6,516 Comments

@Xedecimal,

That list on the LiveDocs is pretty big. They really just need to get rid of this feature altogether or just use the _cfformurl style notation that won't be confused with other valid field names.


Mar 6, 2008 at 10:48 AM // reply »
40 Comments

It's not just the "time" I had fields ending in "date","creditcard", "digits", etc... and each one of those had the same thing trailed by a "_msg". I cured the problem by ending the value form element with an "_1" and the message form element with a "_2" just so that it was easy to process the forms with the message for each one. This is for a jQuery validation generator that i'm working on that allows you to go through a gui to build your validation and to override the built in validation.

Either way, i know if i see this sucker come up again that it has to do with the naming convention.

You saved me time with this post, thank you!


Apr 30, 2008 at 7:11 PM // reply »
3 Comments

Thanks so much for your post. I've been debugging a related error for about two hours now. It was especially odd in that I had two fields, START_NOTICE and START_NOTICE_TIME. Two fields, one with a date and one with the time. Well, for some strange reason, my field START_NOTICE starts taking on the value of "0" and spitting out "1899-12-30" in the FORM scope! After reading this post, I changed the name of START_NOTICE_TIME to START_NOTICETIME and it just all worked! Somehow the validation on the time field was affecting the related field START_NOTICE. I think that is even stranger than the problem with the "_time" in the field name. At least it has stopped. :-)


May 1, 2008 at 7:27 AM // reply »
6,516 Comments

@Brad,

Yeah, that's some old-school, built-in validation. Nobody likes it; I am not sure why it is even still part of ColdFusion.


AJ
May 19, 2008 at 11:53 AM // reply »
1 Comments

thanks for clarifying this. I ran into the exact same problem with a form field called 'invoice_date'. It was working until today, which was very strange. I did add a file upload form field today, so I wonder if it has something to do with that.


May 23, 2008 at 2:36 PM // reply »
1 Comments

i ran into the same problem where text field name was "signature_required"


Jul 21, 2008 at 9:02 AM // reply »
3 Comments

You just saved my day in a pinch!

Thanks!


Jul 21, 2008 at 9:41 AM // reply »
6,516 Comments

@Jared,

Glad to have been a help :)


Sep 25, 2008 at 3:56 AM // reply »
2 Comments

But wait! It gets worse!

I would get an error like the one above on the fields item_arrival_time and item_departure_time, too, depending NOT on the content of those same two fields, but on the content of two different ones (item_departure and item_arrival) being a valid date or not.

It has driven me crazy (when I least needed it)!

If I wanted coldfusion's built-in validation, I'd have used cfform and cfinput, thank you.

Grrrrrrr.


Sep 25, 2008 at 4:00 AM // reply »
2 Comments

I see now that Brad had already reported the same problem. Sorry for the useless post!


Sep 25, 2008 at 8:02 AM // reply »
6,516 Comments

@Andrea,

Voicing a problem with ColdFusion is never "useless". Hopefully, the more people that complain about this implicit validation, the more likely they will to finally remove it from the language. I don't think anyone actually uses this on purpose.


Jan 21, 2009 at 2:08 PM // reply »
1 Comments

I just got one. "Price" by itself with no CFFORM tag in use.


Jun 12, 2009 at 4:02 PM // reply »
1 Comments

I just had another one. I named my field pub_discl and it gave me this Form Entries Incomplete or Invalid. It's really crazy. I was able to rename to something else after I saw all of your posts. Thank you!


Jun 12, 2009 at 4:29 PM // reply »
6,516 Comments

@nchen,

Funky! I wonder what "discl" could even represent in the form validation.


WTL
Jul 29, 2009 at 1:56 PM // reply »
10 Comments

Cripes. I just got this error for the first time in my CF "lifetime" today. Talk about freaking hard to figure out. Adobe, sometimes, you're trying too hard to be helpful. Don't validate unless we *ask* you to. ;-)


Jul 29, 2009 at 2:31 PM // reply »
6,516 Comments

@WTL,

The good news is in CF9, you can actually turn this off! Sweet!


WTL
Jul 29, 2009 at 2:35 PM // reply »
10 Comments

That is great, but at the moment, I'm going to have to wade through 250 form fields (across many pages) and hunt this bugger down.


Jul 29, 2009 at 2:39 PM // reply »
6,516 Comments

@WTL,

Yikes :)


Aug 23, 2009 at 12:20 AM // reply »
1 Comments

Awesome! Thanks for saving me so much time. So obvious after seeing your post.


Post Comment  |  Ask Ben

Recent Blog Comments
Nov 21, 2009 at 6:47 PM
Hal Helms - Real World Object Oriented Development, Sarasota - Day Five
@charlie griefer, Thank you.. ... read »
Nov 21, 2009 at 5:15 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jose Galdamez, Oh heh yeah I didn't paste the whole code. I should have defined the vars -- my bad. It's fixed thou. Thanks. ... read »
Nov 21, 2009 at 4:49 PM
Styling The ColdFusion 8 WriteToBrowser CFImage Output
Great work yet again Ben! Whilst I didn't use this whole code, I copied some of your regex code for a similar problem with the lack of an alt attribute and unescaped ampersands in CFIMAGE for Railo 3 ... read »
Nov 21, 2009 at 1:13 PM
My First ColdFusion Builder Extension - Encrypting And Decrypting CFM / CFC Files
@Ben, Because I am pedantic, I just want to make sure that everyone knows there is absolutely no encryption going on. There is only encoding and obfuscation. The cfencode tool only obfuscates your C ... read »
Nov 21, 2009 at 12:28 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jody I can't seem to get your code sample to work. If you are still having problems, try this code out and see if it gets you what you wanted. <!--- Comma delimited list with various duplicates ... read »
Nov 21, 2009 at 11:03 AM
Groovy Operator Overloading Does Not Work In The ColdFusion Context
Hi Ben, Thanks for this informative post. Now I am reading ur old posts too ... read »
Nov 21, 2009 at 10:56 AM
HostMySite.com Has The Best ColdFusion Hosting
@Mehul, Yes very nice people, however several downtimes per day which was not acceptable. Hence we had to move out. I am glad you are having good luck with them so far. ... read »