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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Save formcontent from many:many relation


Go to End


2 Posts   1643 Views

Avatar
esakrielaart

Community Member, 59 Posts

19 July 2011 at 7:23am

Hello all,

I'm currently struggeling with the following. I have some products which are saved in the database. From this products I wish to create packages containing one ore more products. One product may occure in more than one package and one package may contain multiple products: many-many relation between products and packages.
Now I have some problems to create a code to actually save the selected products. I'm capable to create a form where one may enter a Package name and to generate checkboxes per product (using checkboxSetField). I spend many time searching the web to see if SS had any build in feature for this, but I can't find it. Aren't there any? Do you maybe have a suggestion on how to tackle this problem?

Any help appreciated,
Maurice

Avatar
esakrielaart

Community Member, 59 Posts

19 July 2011 at 10:15am

Found this very promising answer, thanks.

http://www.silverstripe.org/form-questions/show/16256?start=0