I am using ColdFusion 2016. I have a form with a multi-select drop down. The name
attribute of the field is called jobRoleId
. When I submit this form the field name is available in the form scope as jobRoleId[]
. How do I get the value of this field? The name comes across like an array but I can't seem to just dump out the value due to the brackets.
I've tried dumping out the value, but I get an error. I feel like I have done this in the past and the form field name didn't contain the brackets [] after the field name when using a multi select menu:
<select id="jobRoleId" name="jobRoleId" multiple="multiple">...</select>
Is there a way to somehow have the form field name just come across as jobRoleId
?
writedump(jobRoleId[]);
abort;
form["jobRoldId[]"]
. When I submit this form the field name is ... "jobRoleId[]" I think something else is responsible for the name change, not CF. I just tested it with CF2018 and even whenthis.sameFormFieldsAsArray = true;
, it still submitted the field name as "jobRoleId".