cfform Server Side Validation Gotcha

Want to aggravate yourself for 10 minutes? Try this one. Create a cfform. Name a form field "foo_required". Add no other validation whatsoever. Submit the form without populating the field. Go crazy for 10 minutes until you realize that any field names that end in "_required" trigger CFs server side validation. We learn something new everyday huh?

Comments
Uhhmm... actually that is taught in FTCF classes. ;-)

You might try the following suffixes, too:
_integer, _float, _range, _date, _time, _eurodate

Best,

Chris
# Posted By Chris | 2/28/07 3:08 AM
I'll file that under "good to know"! Thanks for the insight!
# Posted By Ryan Everhart | 3/1/07 9:14 AM
I spent more than 10 minutes trying to figure this out this morning! Thanks for listing the list of suffixes that can cause the problem.

I noticed that if you use a regular form and have a form field that uses one of these suffixes, the field will go missing from the fieldnames variable. However, the content of the variable will still be present in the form (if you do a cfdump).

I met this problem trying to figure out why a form variable wouldn't appear in the attribute scope while using the FormURL2Attribute custom tag. It had the suffix _date.
# Posted By Dan | 5/31/07 12:01 PM

Calendar

Sun Mon Tue Wed Thu Fri Sat
     12
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       

Subscribe

Enter your email address to subscribe to this blog.

Tags

actionscript ajax blogging cfsnippets coldfusion flash forms flex funny stuff misc model-glue off topic personal project learn slidesix sql

Recent Comments

Adding Auto Generated Code Downloads to BlogCFC
ada5fsa said: http://www.mountwashingto... http://extjs.com/forum/me... h... [More]

BlogCFC Survey #2
ada5fsa said: http://www.mountwashingto... http://extjs.com/forum/me... h... [More]

Most Difficult Captcha Of All Time
kokkooo said: [url=http://synchrophase.info/...]消費者金融 ブラック[/url] [url=http://geji-geji.com/]消費者金融ブラック[/url] [url=http... [More]

Most Difficult Captcha Of All Time
kokkooo said: <a href="http://synchrophase.info/...">消費者金融 ブラック</a> <a href="http://gej... [More]

Using A PlayStation 2 HDD In Your PC
Vodin said: Well dang. Thanks man, my uncle who owns a Video Game shop had a PS2 harddrive in the junk box, I sn... [More]

RSS


coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com