views:

496

answers:

3

I must be losing my mind.

<cfif cgi.request_method eq "POST">
    <cfoutput>
     Form.fieldnames = #form.fieldnames#<br>
     structKeyList(form) = #structKeyList(form)#
    </cfoutput>
</cfif>

<form  method="post" accept-charset="utf-8">

    <input type="text" name="graduation_date" value="x"><br>
    <input type="text" name="foo" value="y"><br>
    <input type="text" name="bar" value="z"><br>

    <input type="submit" value="Submit Form" >

</form>

The form.fieldnames variable should include a list of submitted fields: foo, bar, and graduation_date. But graduation_date is missing.

After a little more testing, I see that anything ending in _date is excluded from form.fieldnames.

I was going to ask what's wrong with my code, but now I'm pretty convinced it's a bug in ColdFusion. (I'm on ColdFusion 8.0.1 / OS X 10.5.6.)

It's a bug in ColdFusion, right?

+11  A: 

Maybe it's the custom validation feature?

matt eisenberg
Yes, apparently that's it. Still a bug IMHO, but it's good to know what the underlying cause is. And that I haven't lost my mind. :-)
Patrick McElhaney
It's not a bug, it's just a really bad decision that's been maintained for the sake of backwards compatibility.
Adam Tuttle
+3  A: 

patrick,

you're not the only person in the world that would like this "feature" to go away, or at least be able to disable it in my application. kinda sad that we now can set almost any setting in the application.cfc except for this PITA.

rip747
A: 

Yep I ran into this little problem as well with ColdFusion 8. I was practically ready to flight test my server trying to figure out why a text box named "asof_date" was not being procesed nor was it showing up in the FIELDNAMES field in my posted data (which explains why it was being ignored). I call this a bug in terms of orthogonality. As soon as I changed the name to "pub_asof" it worked fine. Argh!!

CBortz