Reputation:
I am working on a Legacy Application and they are using Application.cfm, now that file cannot be converted to Application.cfc due to the fact that the site is too big and probably making a change will make it unstable
In one of the Pages, I have defined the form field as: keys[]
to return me an array. I have defined the
<cfset this.sameformfieldsasarray = "true">
in Application.cfm under the cfapplication
tag
But that does not seems to be working, it just creates the list rather than an array.
So Question is:
i am using coldfusion Version 11
Upvotes: 0
Views: 184
Reputation: 6884
OP's mistake was in trying to set that sameformfieldsasarray
setting via a cfset
of the this
scope AFTER ("under") the cfapplication
they had. That would be appropriate only in an application.cfc
. When using application.cfm
instead, they should have simply set it as an attribute of the cfapplication
tag:
<cfapplication sameformfieldsasarray="true">
(or false, if desired)
Sadly, most docs and resources mentioning this sameformfieldsasarray
feature (and other features that can be set in the this
scope of an application.cfc
) tend to not mention how nearly all of them can be set as attributes of cfapplication
as well.
Upvotes: 0
Reputation: 11120
I think you are setting the value to be a string rather than a boolean
<cfset this.sameformfieldsasarray = "true">
Should be
<cfset this.sameformfieldsasarray = true>
Also consider using application.cfc
Upvotes: 0