我使用 Drupal 6 和 AHAH 来自定义我的节点表单。对于啊,我使用以下代码:
function mymodule_subtopic_type() {
$output = '';
$form_state = array('storage' => null, 'submitted' => false, 'rebuild' => true);
$form_build_id = $_POST['form_build_id'];
$form = form_get_cache($form_build_id, $form_state);
$args = $form['#parameters'];
$form_id = array_shift($args);
$form_state['post'] = $_POST;
$form['#post'] = $_POST;
$form['#programmed'] = false;
$form['#redirect'] = false;
drupal_process_form($form_id, $form, $form_state);
$form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
$topic_form = $form['topic_wrapper'];
unset($topic_form['#prefix'], $topic_form['#suffix']);
$output .= theme('status_messages');
$output .= drupal_render($topic_form);
drupal_json(array('status' => TRUE, 'data' => $output));
}
新表单元素呈现良好,但我收到状态消息:
- 标题字段是必需的。
- 描述字段是必需的。
ahah 通话后如何停止验证?