I’m trying to wrap my head around a Model that allows for multiple checkbox options.
For example, say I’ve got a group called “ValidTimes” … I’ve then got checkboxes for all of the ValidTimes that should be saved.
Right now, my Model has a string ValidTimes { get; set; } but I’m not sure how I’m supposed to check more than 1 value against my model…
Not to mention validating against that model to make sure that there is at least one value selected.
Should my Model consist of all possible options within that Checkbox group?
This is quite an extensive issue. I have figured out how to not only post the state of each checkbox, but also retain the state when returning to the View.
Radio buttons tended to be the biggest pain, but by using a string property as a placeholder for the radio button value, you are able to retain that state as well.