0
我試圖放在一起將有它自己的配置頁面的模塊。爲此,我使用下面的代碼作爲我的菜單頁面回調:Drupal 7 hook_menu複選框問題
function webform_customizations_customize() {
$form = array();
// Text field for the e-mail subject.
$form['webform_customizations']['user_warn_e-mail_subject'] = array(
'#type' => 'textfield',
'#title' => t('Warning e-mail subject'),
'#description' => t('The subject of the e-mail which will be sent
to users.'),
'#size' => 40,
'#maxlength' => 120,
'#required' => TRUE,
);
$options = array('A', 'B', 'C');
$form['test'] = array(
'#type' => 'radios',
'#options' => array(
'one' => t('one'),
'two' => t('two'),
),
'#title' => t('roles that should see a minimal webforms setting area'),
'#title_display' => t('testing'),
);
$form['high_school']['tests_taken'] = array(
'#type' => 'checkboxes',
'#options' => drupal_map_assoc(array(t('SAT'), t('ACT'))),
'#title' => t('What standardized tests did you take?'),
'#states' => array(
'visible' => array(// action to take.
':input[name="student_type"]' => array('value' => 'high_school'),
),
),
);
return $form;
}
道歉長碼。
我的問題是我嘗試顯示覆選框失敗。第一個字段成功顯示文本字段。但接下來的兩個是從未在我的配置頁面上顯示的複選框,並且tests_taken複選框代碼直接從this drupal doc page中解除,沒有任何修改。
我試過一個複選框,並且工作正常。
請幫忙。