Drupal 6 #表单中的自动完成路径创建JS错误
我试图在我的文本字段中使用#autocomplete_路径。但它会显示错误信息。同样的问题也发生在使用AHAH时 代码:Drupal 6 #表单中的自动完成路径创建JS错误,drupal-6,drupal-modules,drupal-views,drupal-theming,Drupal 6,Drupal Modules,Drupal Views,Drupal Theming,我试图在我的文本字段中使用#autocomplete_路径。但它会显示错误信息。同样的问题也发生在使用AHAH时 代码: $form['test_module']['user_name'] = array( '#type' => 'textfield', '#title' => t('Name of user'), '#name' => 'user_name', '#required' => TRUE, '#attributes' => array('cla
$form['test_module']['user_name'] = array(
'#type' => 'textfield',
'#title' => t('Name of user'),
'#name' => 'user_name',
'#required' => TRUE,
'#attributes' => array('class' => 'inputtext'),
'#id' => 'forminput_fn',
'#default_value' => 'User Name',
'#autocomplete_path' => 'user/autocomplete',
);
警报框出现以下错误
发生了一个错误。数组([0]=>){“admin”:“admin”}
请帮我解决这个问题。我找到了确切的问题。这是我的错。我在drupal hook_init()函数中给出了print。 自动完成将在显示之前将输出转换为JSON。如果我们在hook_init()中打印任何将添加到实际响应中的数组。所以这对JS来说是无效的格式。因此JS无法解析正确的响应 谢谢