CCK checkboxes still behave as optional
| Project: | Checkbox Validate |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
I installed this module to fix a problem where a checkbox in a content type I had created using the CCK behaved as an optional field even when marked as required. It made no difference at all unfortunately.
I had a look at the code and I've put in a fix. With this new code the checkbox behaves as a required field should but I was unable to find a way to automatically mark it as required (i.e. with the asterisk showing next to the field). I have worked around this in my site by putting the span tag needed at the end of the on description. I've attached a screenshot of the CCK checkbox configuration which I hope will make this a bit clearer.
The patch is against checkbox_validate 6.x-1.1 and I'm running Drupal 6.6
The CCK checkbox field is of a different type to the one in the registration form, I've updated the code to check for this new type and handle it as well.
There was also what looks like a typo in the original code that may have stopped it working for checkboxes in the registration form, there were two parameters being passed into the checkbox_validate_recurse function which only expected one. I've fixed it and the module definitely works for the registration form with this version but I didn't test it before the fix.
| Attachment | Size |
|---|---|
| cck_checkbox_configuration_screen.png | 188.12 KB |
| checkbox_validation-update-for-cck.patch | 1.7 KB |

#1
Thanks, it works!
But anyway... this heavy drupal-bug has to be fixed!! Immediately!!!
#2
Thank you, with the patch the module worked for me as well...
#3
thanks it worked.
#4
Thanks a lot! Also fixes broken Checkbox Validate module for me.
#5
validates (reports error if not set), but doesn't seem to mark as required with the asterisk or outline in red.
#6
Checkbox Validate is not working for me. What an annoying bug! Running D6.13, CCK 6.x-2.4.
#7
Subscribing
#8
Thanks for submitting that patch, worked like a charm for me.
#9
Using D6.13 with 6.x-2.5 and neither the "Check Validate Module" nor this patch work for me. What a pity.
#10
Check the issue queue, you will find an updated patch here -- http://drupal.org/node/425096