Closed patrickmj closed 8 years ago
Not sure this has anything to do with the multicheckbox problem, but you need to explicitly call setIsRequired()
on the element object. It doesn't pick up that setting when using factory-style element creation.
Yeah, looks like that is the problem. I shoulda noticed that setIsRequired()
also sets the attribute, so with this pattern the required
attribute shouldn't go in the attributes array. As you said in slack, not intuitive!
Per convo about #29, on branch filter-fix I switched to extending Zend's MultiCheckbox. That fixed everything as long as I said that the element was not required, but when I switch to requiring the element, it requires that all the checkboxes be checked, which is not what we want.
Not sure if that's a problem with how I'm building the form, or with the general Omeka S javascripts that check required stuff. Could use advice from @zerocrates and @jimsafley