Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Group fields for easy processing

Go to End



Community Member, 81 Posts

1 November 2009 at 5:21pm

I'm building a form that will give authorized users the ability to submit orders for products. It is populated from a dataobjectset and for each object shows a product code and name as literal fields with paired hidden fields to pass the data and fields for selecting a quantity and product size. Once submitted the selections are processed into an email with the users info and sent off. The rest of the transaction is handled outside of the website.

A copy of my current code can be found here (I'm using the multiform module):

At the bottom that page you can see an example of how data is output from the form.

What I would like to find is a way of grouping the fields so that they are easier to work with by product rather than one long array.
The best solution I have so far is to write a method that will iterate through the submitted form data and rebuild it as multi-dimensional array like this example.

Any thoughts?