Using drupal 5, and cck 5.x-1.7 here.

How do I get rid of the "N/A" in a radio button list. Googled Drupal and didn't find anything, but then I'm no Google pro.

Comments

st45’s picture

!@#$!@#$ 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.

yched’s picture

Status: Active » Fixed
hnln’s picture

I have this issue on drupal 6 and I don't want the field to be required.

drewish’s picture

HnLn, then add a "default item".

giorgio79’s picture

Setting a default value for me did not help. the NA remains

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

ifoundthetao’s picture

I 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.

esmailzadeh’s picture

subscribing

cyu’s picture

Version: 5.x-1.7 » 6.x-2.1
Component: text.module » optionwidgets.module
Status: Closed (fixed) » Active

I 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.

yched’s picture

Status: Active » Fixed

Radios 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

cyu’s picture

Thanks, 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

liquidcms’s picture

Status: Closed (fixed) » Active

pretty 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.

liquidcms’s picture

tried creating a new field outside of multi group.. and still can't get rid of N/A

cyu’s picture

Status: Active » Closed (fixed)

@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.

jweedman’s picture

Where 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.