When creating a form with type tableselect and you're using multiple values and in addition, you're assigning default values to your checkboxes to determine the checked state, the check states are always checked.

Example: You have a form that a user checks off some options and you save it to your database, then when retrieving the data, you'd get back the options the user saved. Therefore, you'll want to display those checkboxes as already checked.
However, when supplying the default values array, all the checkboxes are checked off regardless of your input from the array.

Comments

angsar’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.1 KB

See patch attached.

greggles’s picture

The patch should remove code instead of commenting it out. It also looks like there are some whitespace (indentation) problems on the $default = line - see coding standards for details.

Conceptually this makes sense to me, so leaving as needs review in spite of those trivial problems with the patch.

nancydru’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

6.x no longer supported