开发者

drupal,cck---Remove "N/A" from list of radio button choices

开发者 https://www.devze.com 2023-01-27 04:33 出处:网络
the follow code is fro开发者_如何学Cm it\'s documentation,it\'s too abstract. expect someone can help me how to do it.

the follow code is fro开发者_如何学Cm it's documentation,it's too abstract. expect someone can help me how to do it.

Removing CCK N/A field using a preprocess function...

Before you assign your radios to a variable use the following code:

 <?php
unset($vars['form']['group_if_in_fieldset']['field_the_radios']['value']['']); //remove  the pesky CCK N/A radio
?>

i have put the code into the mytheme_preprocess_node(){} but it can't work.


if you want to remove N/A then make the field required, it should go away.


My guess would be that the strings used as indices are only placeholders. If you have created a CCK field called "item_status", your field will likely be called "field_item_status", not "field_the_radios". Same goes to the fieldset group name (if you happen to have your radios in a group).

0

精彩评论

暂无评论...
验证码 换一张
取 消