Closed (duplicate)
Project:
Content Construction Kit (CCK)
Version:
6.x-3.x-dev
Component:
optionwidgets.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2010 at 19:56 UTC
Updated:
25 Jul 2013 at 07:38 UTC
Comments
Comment #1
davidburnshttp://drupal.org/project/checkbox_validate
Comment #2
blueblade commentedHi davexoxide,
Thanks for your help. I have just installed Checkbox Validate and set up an CCK "Integer" field with
in the "Allowed values list" box but the single check box is still not set as required. I read the "Read me" file that comes with Checkbox Validate but didnt see anything else that it says I need to do. Do you have any idea what I may be missing here? I am using Drupal 6.15.
Thanks again.
BB
Comment #3
jethro commentedI am having the same issue before and after trying the above module. Did anyone get this to work?
Comment #4
grendzy commentedthe checkbox_validate module doesn't work here, because the single checkbox doesn't use the checkbox FAPI element - it creates it's own called "optionwidgets_onoff".
You can workaround this by using a regular option/radio widget. Set it to required, unlimited, and provide only one allowed value. (you still need the checkbox_validate module with this approach). BTW I'm using 2.6, I haven't verified this bug exists in 3.x.
Comment #5
larskleiner commentedI put up a patch at http://drupal.org/node/768732 which adds optionwidgets_onoff support to the checkbox_validate module.
Comment #6
tim.plunkettThe original support request was fixed, marking this as a dupe of #768732: Add optionwidgets_onoff support
Comment #7
amaisano commentedThis workaround was perfect for me (#4) - thanks! I am running 6.x-3.0-alpha3+13-dev of CCK, but still had the same buggy single on/off checbox issues.
Comment #8
thomasmurphy commentedYou can do this without checkbox_validate. Just create a textbox/radio button cck field, make it required, set it to allow 2 values. Only put one "1|agree" in the allowed values, but leave the default value unchecked. Now when the form is submitted it will refuse the submission and specify that the terms are required unless the user selects the option.
Comment #9
marleo commentedthomasmurphy: Excellent. Never would have occurred to me. Thanks.