Jump to:
| Project: | Checkbox Validate |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
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 |
Comments
#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
#11
The patch in #1 works for me, but the other thread's patch did not. One of these needs finishing testing and committing to the module.
#12
Is there a patch file for version 5.x-1.0?
Or is it possible to use a patched version 6 checkbox_validate.module file on a D5 site?
Using D5.21 with CCK 5.x-1.10 and the checkbox_validate seems to have no effect.
Required single checkbox field is still not validated (node can be submitted with box unchecked) and no required field red star appears next to field on node edit page.
Checkbox is for terms agreement that is required to submit node.
Thanks for any help or advice.
#13
Thanks for taking the time to report this issue.
However, marking as duplicate of #425096: Properly use Form API.
You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.