I am trying to submit and access a subset of a form submitted, in a similar way as with nested forms can be done in rails and (from memory) with cfwheels.
In rails and wheels, a form inputs name can be “address[town]”. This can then be accessed as an array called ‘address’ when the form is submitted.
For example, I have the following fields:
`
`
When I then submit this form, I want to be able to access each address as seperate objects with #rc.address1# and #rc.address2#, but I get an error that address1 does not exist in rc
With rails and cfwheels, a form can bee accessed this way with params.address1 and params.address2. Does anyone know if there is any way in Coldbox to be able to pass and receive a form in this manner?
Well, that would be correct then. ColdBox doesn’t do any automatic parsing of specially-named form or URL fields. The rc struct presents the variables to you the same way they would show up in the form or URL scope.
The Form Utilities plugin will get you want you need. In fact, it’s probably what CFWheels uses. The third link Joel posted is a video where I show exactly how to set it up in your application.
Brad, your interceptor video gave me exactly what I needed. Thank you ! Viva La Coldbox!!
Andrew, dev box is CF10, but wasn’t converting. Not sure if it’s a setting(?) But my experience with cf10 is that dot notation in forms is not converting to struct.
Yeah I was guessing, Adobe to make changes to what and how something is passed, to the point it broke a lot of things when it was first released. I know it had something to do with how forms are passed into ColdFusion… It had something to do with arrays.