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.

Form Questions /

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

[SS 2.4] How to create a tutorial poll form with multiple values?


Go to End


1228 Views

Avatar
Imploosio

Community Member, 5 Posts

1 October 2012 at 2:33am

Hi,

I'm trying to re-create a poll similar to what is described in this tutorial: http://doc.silverstripe.org/framework/en/2.4/tutorials/3-forms

However, I need to use checkboxes instead of radio buttons to allow multiple answers (CheckboxSetField instead of OptionsetField). I'm a little stumped on what would be the best way to save and process the values, I've tried to change the submission model into has_many or many_many in hopes of eliminating the need to save data into the database in comma separated values.

What is the best way to do this? To save the data into a database in correct format and spit it out as a neat little bar graph just like in the original tutorial? Any help is highly appreciated.