我想看看我是否可以檢查多個條件...如果fieldname是35或27那麼就需要它...如何添加/或爲#states條件=>值?在Drupal的狀態
是否可以在Drupal 7 FAPI中執行多個條件#狀態?
$form['field_fiscal_year'] = array(
'#states' => array(
// Only show this field when the 'select list' is either 35 or 27
'required' => array(
':input[name="field_doc_type[und]"]' => array('value' => 35),
':input[name="field_doc_type[und]"]' => array('value' => 27),
),
));
確認!這工作! – leymannx 2013-11-28 18:44:34