Jump to:

2012 Posts in 1438 Topics by 621 members

Form Questions

SilverStripe Forums » Form Questions » Group fields for easy processing

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

Page: 1
Go to End
Author Topic: 1011 Views
  • JoshuaLewis
    Community Member
    76 Posts

    Group fields for easy processing Link to this post

    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): http://pastie.org/677713

    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. http://pastie.org/678572

    Any thoughts?

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.