ColdFusion MX funkiness

I’ve discovered a thing to be cautious of when developing using Coldfusion MX (it appears to be no longer an issue in CFMX 7):

When creating form fields, don’t make the field’s name end in ‘_required’. Doing so triggers some sort of automatic Cold Fusion validation processing. You’re quite likely to see an error like: “Form entries incomplete or invalid.”

So to prevent any futher hair-pulling on anyone’s part, I’m recording this fact here for posterity.

8 Replies to “ColdFusion MX funkiness”

  1. Son of gun! Thanks so much!! I really would have pulled out all of my hair trying to figure out why I’m getting this crappy error! Funny thing is, I had a checkbox named “something_required” which worked for months, but it didn’t give me the error until I switched it to a select.

  2. Son of gun! Thanks so much!! I really would have pulled out all of my hair trying to figure out why I’m getting this crappy error! Funny thing is, I had a checkbox named “something_required” which worked for months, but it didn’t give me the error until I switched it to a select.

  3. It’s back in MX 7 with a twist. If you use _complete you get the same error. I simply changed it to _completed and everything worked fine.

  4. It’s back in MX 7 with a twist. If you use _complete you get the same error. I simply changed it to _completed and everything worked fine.

  5. SOLUTION: In my case I had a table field called ‘DTE_REQUIRED’ which was causing the hidden validator to fire (e.g. ‘_required’). Because this name was being used throughout my application and database (CFMs, views, triggers, procedures, etc.) it was not practical to change it. To get around this problem I just added a hidden input text tag and set it with a benign value (e.g. ) which satisfies the hidden validator. This should also work for the other validators. For example a field named ‘MY_DATE’ could be used by adding an appropriate input tag to fool the validator (e.g. ).

  6. SOLUTION: In my case I had a table field called ‘DTE_REQUIRED’ which was causing the hidden validator to fire (e.g. ‘_required’). Because this name was being used throughout my application and database (CFMs, views, triggers, procedures, etc.) it was not practical to change it. To get around this problem I just added a hidden input text tag and set it with a benign value (e.g. ) which satisfies the hidden validator. This should also work for the other validators. For example a field named ‘MY_DATE’ could be used by adding an appropriate input tag to fool the validator (e.g. ).

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.