Reserved words and Coldfusion

I ran into an interesting issue today. I had form variables whose names ended in _date. When i was testing I output the form variables using CFDUMP and they appeared in the list of variables passed.

However when trying to insert the list of variables into a database all of my _date variables were missing.

I soon learned that when you use the FORM Scope you can not use variables ending in _date. #FORM.FIELDNAMES# will not contain these fieldsnames so looping does not capture all of them. I had to rename my Form Elements to _dt to be sure they would be passed.

You can read more about coldfusion naming conventions here http://www.oreillynet.com/pub/a/oreilly/web/news/coldfusion_0701.html

Cup size   
Select size then click on coffee cup.
This entry was posted in Code, Coldfusion, Problems & Fixes. Bookmark the permalink.