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
   1234
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 javascript misc model-glue off topic personal project learn slidesix sql

Recent Comments

Adding Auto Generated Code Downloads to BlogCFC
ada5fsa said: http://www.ibiblio.org/st... http://www.ncaonline.org/...... [More]

Chinese Birth Calendar Accuracy Test
mama to be said: ok so i will be 2 months shy of 18 when i have my baby. this calendar does not technically work for ... [More]

Fixing 'User Profile Service Failed The Logon' on Vista
Mike said: That fix worked although all i did was remove .bak and reset state to 0. User was able to log in to... [More]

Chinese Birth Calendar Accuracy Test
Melissa said: Wrong for my daughter, which it predicted to be a boy... we'll see for #2. Predicts a girl (maybe, f... [More]

Adding Auto Generated Code Downloads to BlogCFC
fweerw said: http://www.ibiblio.org/st... http://www.cambodia.ait.a...... [More]

RSS


adobe community experts

coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com