Copy link to clipboard
Copied
When I try to access the values using #form.data[list_id]# for example, I get a ColdFusion error, I’m guessing because it thinks I’m trying to access an array element. Any help appreciated.
struct | |
DATA[LIST_ID] | 000000000 |
DATA[NEW_EMAIL] | foo@bar.com |
DATA[NEW_ID] | 000000000 |
DATA[OLD_EMAIL] | foo@bar.com |
FIELDNAMES | TYPE,FIRED_AT,DATA[NEW_ID],DATA[NEW_EMAIL],DATA[OLD_EMAIL],DATA[LIST_ID] |
FIRED_AT | 2010-03-08 17:49:09 |
TEMPID | [empty string] |
TYPE | upemail |
One can access struct members either via dot-noation if the keys are "valid variable names", or via bracket notation, eg:
myStruct["myKey"]
Using bracket notation does not have the valid-variable-name restrictions that dot notation has.
--
Adam
Copy link to clipboard
Copied
One can access struct members either via dot-noation if the keys are "valid variable names", or via bracket notation, eg:
myStruct["myKey"]
Using bracket notation does not have the valid-variable-name restrictions that dot notation has.
--
Adam
Copy link to clipboard
Copied
So in the case of my example the correct syntax would be
#form["data[list_id]"]#
correct?
Thanks,
Chris
Copy link to clipboard
Copied
Sure. Easiest way to find out is to try it...
--
Adam