Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-2.1
Component:
optionwidgets.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Jul 2008 at 17:33 UTC
Updated:
10 Dec 2009 at 22:46 UTC
Comments
Comment #1
st45 commented!@#$!@#$ I knew I'd find the answer _after_ I posted my very first support request!
So, for all newbies out there, Just check the "Required" checkbox further down the configuration page.
Comment #2
yched commentedComment #3
hnln commentedI have this issue on drupal 6 and I don't want the field to be required.
Comment #4
drewish commentedHnLn, then add a "default item".
Comment #5
giorgio79 commentedSetting a default value for me did not help. the NA remains
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
ifoundthetao commentedI have this issue too. I don't want the field to be required either.
But if we're using this for radios, and we have a default value, then whether or not we want, the field will be required.
The only difference though, is the red asterisk, which can be removed via some simple CSS.
Comment #8
esmailzadeh commentedsubscribing
Comment #9
cyu commentedI also don't understand this behavior and still see it in D6. The solutions listed are ways to get around the problem, but I still have a use case which these don't cover.
If I have a text field, using the Checkboxes/Radio Buttons widget, and want to have 2 radio buttons (yes/no), but don't want to make the field required and also don't want one of the radios selected by default, why am I forced to then have a N/A radio button added and selected by default? The desired behavior would be to have only the "yes" and "no" radios show up unselected and for the user to potentially submit the form with neither of those selected.
Comment #10
yched commentedRadios cannot be unselected once a value was clicked. If there was no 'N/A' value, the field couldn't be set back to empty.
So saying "I don't want a 'n/a' text but I don't want the field to be required" has little sense.
This 'N/A' text is themeable, you can change it by overriding optionwidget.module's theme_optionwidgets_none() function
Comment #11
cyu commentedThanks, I follow your logic. It would be nice if an explanation of this sort appeared somewhere in the field configuration to help clear up confusion for people not knowing why this N/A option is added and why making the field required gets rid of it. Maybe as the help text of Default value, Required, or Allowed Values.
Comment #13
liquidcms commentedpretty sure still issues here.
i have 2 options set as radios
with allowed values of:
0|Do Not Save in Contacts List
1|Save in Contacts List
Required is SET
and default is set to:
Do Not Save in Contacts List
also, in default list, N/A does not show.
But on my form, the N/A is still showing and it is used as the default even though Do Not Save in Contacts List is set as default.
Not sure if this could be part of the problem; but my radio group is part of an "under-devel" multifield group.
Comment #14
liquidcms commentedtried creating a new field outside of multi group.. and still can't get rid of N/A
Comment #15
cyu commented@liquidcms: If you look here at the multigroup issue http://drupal.org/node/119102#comment-1177530 you will see why you are getting an N/A when your field is part of a multigroup fieldset. The gist of it is that when it is part of a multigroup, it is never really required because it can be a part of an empty fieldset, and it order for the fieldset to be emptied N/A needs to be an option.
I was unable to recreate your problem outside of multigroup though. Creating a new field or moving an existing field out of a multigroup and then setting it to required gives me a field without the N/A option. I also tried putting the field in a standard group and did have the N/A option appended, but if you are seeing oddities it is probably due to a particular multigroup patch and you should post any issues you have at #119102: Combo field - group different fields into one.
Comment #16
jweedman commentedWhere do you set this default value!? I've been working on this for hours, and nowhere in the configuration do I see a default value option on a CCK Checkbox field. Any help would be greatly appreciated.