I made a field in text list format with radio button widget and I want to remove the N/A option, but my field must be not required.
I tried this code without success.
function mymodule_element_info_alter(array &$types) {
if (isset($types['radios'])) {
$types['radios']['#process'][] = 'remove_radio_na';
}
}
function remove_radio_na($element) {
if ($element['#field_name']=='field_align_image') {
unset($element['_none']);
}
return $element;
}
Do you have an idea on how I can solve my issue?
<select>
element instead.