N/A Radio buttons are on every List(text) field even when the "required" option is set. Effectively removing the "required" option.
I am using Drupal 7.14, Profile2, OG and Entity.
I found this issue as I was making custom profile page and adding fields. So far I can't see how to fix it.
Comments
Comment #1
alanom commentedSame issue but with a different theme (actually with the standard Seven theme)
Comment #2
FABcode commentedI've searched this issue many ways - saw code for CCK and for Profile (1) but none of this can be translated directly to Profile2. I'd like tor emove the N/A choice from a checkbox list, or radio buttons whether required or not. I have not found any answer that explains completely how to do this. I'm using MAYO theme version.
Comment #3
cellar door commentedput the following in a js file in your theme to remove all the N/A options without having to write any preprocess functions, or mark the item as required.
This took me searching all over to actually find out there's no easy way to do this, that's when I turned to jquery and just did it there.
Comment #4
FABcode commentedIt looked simple enough but didn't work for me. I'll try to email you more specifics and maybe there's something I'm missing.
Thanks.
Comment #5
FABcode commentedI'm closing out this issue. The issue went away when I fixed the column layout from webform. There was some interference for ds because of the 3 column layout. When I reset that back to one column then webform started to behave correctly.
Comment #6
FABcode commentedComment #7
yfarooq commentedOne of the interesting Features of Drupal 7 is the Field API. Prior to Drupal 6, to make a custom field the Core Profile Module and Content Profile Modules are used. Now in Drupal 7 we can make any custom field to appear in User Registration Form. When Adding Custom Fields Such as Gender usually we use Radio Button Input. However there is a small Problem with the core module as it displays the third option N/A in the input. To Remove the N/A option the field needs to be set as mandatory. To Remove this option there is another way. Go to modules/field/modules/options/options.module and comment the the code $properties['empty_option'] = ‘option_none’ as shown below under buttons.
case ‘buttons’:
$properties = array(
‘filter_xss’ => TRUE,
);
// Add a ‘none’ option for non-required radio buttons.
if (!$required && !$multiple) {
//$properties['empty_option'] = ‘option_none’;
}
break;
case ‘onoff’:
$properties = array(
‘filter_xss’ => TRUE,
);
break;
}
However the proper way to achieve it would be to override this function in custom module. But for a quick fix we can also follow this method. [blog]: http://yamafm.wordpress.com/ "click here for updates"