How do I hide a CCK Nodereference input widget in #after_build?

拟墨画扇 提交于 2019-12-02 12:21:10

Hidden is not enough. Try this one:

$form['field_my_nodereference_field'][0]['#type'] = 'nodereference_hidden';

when the type is a CCK field you have to pass this format _hidden

for instance for a simple text field I used

$form['field_srt'][0]['#type'] = 'text_hidden';

or for a filefield field I used

$form['field_myfile'][0]['#type'] = 'filefield_hidden';
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!