我试图将“显示”复选框添加到多个cck文本框。下面的代码确实添加了该字段,但是当我提交表单时,我在验证表单时没有看到$ form_state数组中的值。以编程方式更改CCK文本框
我会做什么错?
<?php
/**
* Implementation of hook_form_FORM_ID_alter().
*/
function leghist_form_paleghist_node_form_alter(&$form, &$form_state) {
//Add function to manipulate cck node form
$form['#after_build'][] = 'leghist_cck_after_build';
}
/**
* Implementation of hook after_build();
*/
function leghist_cck_after_build ($form, &$form_state) {
//Add display option to titles
foreach (element_children($form['field_lg_pop_names']) as $key) {
$form['field_lg_pop_names'][$key]['display'] = array(
'#type' => 'checkbox',
'#title' => t('Display'),
'#process' => array('leghist_display_process')
);
}
return $form;
}
/**
* Implementation of hook element_process
*/
function leghist_display_process($element) {
dsm('yuk');
}
?>