• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

form.fieldNames "missing" fields

Explorer ,
May 29, 2007 May 29, 2007

Copy link to clipboard

Copied

I have discovered during recent testing that certain field names are not included in the form.fieldNames list,
In particular, I had a form that included text input fields named "event_arrival_date" and "event_departure_date."
Upon submitting the form, the values of these two fields COULD BE OUTPUT, but WERE NOT included in the form.fieldNames variable. I tested using FireFox 2.2 AND IE 6, so I'm assumming this is a ColdFusion problem.
Upon removing the "_date" portion of the filed names, they were included in the fieldNames variable.
Can anyone explain this bug? Security feature?
TOPICS
Advanced techniques

Views

441

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 29, 2007 May 29, 2007

Copy link to clipboard

Copied

Hi,

_date, _cfformdate, _eurodate, _cfformeurodate and _cfformusdate all are part of Coldfusion's way of validating a form using the predefined hidden fields... So you cant suffix this values in your element names.. Its actually a feature and not a bug..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 29, 2007 May 29, 2007

Copy link to clipboard

Copied

Daverms,
Thanks for the info.
My only complaint would be the lack of a CF error page indicating the problem.
Instead, the fields are just left out.
This poses a problem to those who have coded their processing page using the FORM.FIELDNAMES list and <CFLOOOP>.
In any case, thanks for the response!
"Security feature?"...I DID acknowledge that possibility!! :-)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 31, 2007 May 31, 2007

Copy link to clipboard

Copied

You could always loop through the form collection instead ;-)

<cfloop collection="#form#" item="fieldName">
<cfoutput>#fieldName#=#form[fieldName]#<br></cfoutput>
</cfloop>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2007 Jun 07, 2007

Copy link to clipboard

Copied

LATEST
Try using a <cf_dump var=#form#> to see what's really being sent by the form

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation