Forums | Mahara Community
04 September 2009, 4:39 PM
I have a form where a checkbox disables the other checkboxes in the group to ensure that only that checkbox is submitted. It's used to specify access permissions for a new section I'm working on. It works fine unless the user submits the form without filling in a required field. If that happens, all the checkboxes are enabled again.
07 September 2009, 7:58 AM
Hm, interesting question. I'm guessing you're using 'defaultvalue' => true for the checkboxes, which is right. Technically, disabling the checkbox and submitting the form (with a validation error elsewhere) should result in the checkbox not being checked. Maybe that isn't happening though - checkboxes aren't sent through when they're unchecked, that could be causing an issue.
Can you try reducing the form to a simple example that demonstrates the behaviour? I'll have a look into it if you find that with a simple pieform it's showing undesirable behaviour.
10 September 2009, 2:02 AM
Not a big deal, though, because I just used jQuery to disable the appropriate checkboxes if the form failed to pass validation.
10 September 2009, 4:55 PMWell pieforms should do that for you automatically, is what I'm saying . And I was pretty sure it did, but it's hard to say without knowing a bit more, like your form definition.