我在表单挂钩中定义了以下元素:
$form['touchpointdivision'] = array(
'#type' => 'select',
'#title' => t('Division'),
'#options' => $divisions,
'#required' => TRUE,
'#ajax' => array(
'event' => 'change',
'wrapper' => 'department-wrapper',
'callback' => 'touchpoints_dept_callback',
'method' => 'replace'
)
);
$form['touchpointdepartment'] = array(
'#type' => 'select',
'#title' => t('Department'),
'#prefix' => '<div id="department-wrapper">',
'#suffix' => '</div>',
'#options' => _get_departments($selected),
'#required' => TRUE
);
这是回调:
function touchpoints_dept_callback($form, $form_state){
return $form('touchpointdepartment');
}
当我在第一个下拉列表中更改项目时,出现以下错误:
“致命错误:函数名称必须是第 203 行 /cmi/sites/all/modules/touchpoints/touchpoints.module 中的字符串”
我在这份声明中遗漏了什么?