0 => t("Проектор"),
1 => t("Ноутбук"),
2 => t("Колонки"),
3 => t("Микрофон"),
4 => t("Другое"),
);
$form['compl'] = array(
'#type' => 'checkboxes',
'#title' => t('Выборка'),
'#default_value' => array(0,1),
#variable_get('feed_item_length','full'),
'#options' => $complect,
'#description' => t('Здесь хочу выбор'),
);
$form['dataS'] = array(
'#type' => 'textfield',
'#title' => t('С '),
'#size' => 25,
'#states' => array(
'visible' => array(
':input[name="compl"]' => array('value' => 4),
),
),
);
Нужно что бы поле отображалось только если стоит птичка на "другое"...
Комментарии
"Другое" сделайте отдельным чекбоксом и в условии не value, а checked
'#type' => 'checkbox',
'#title' => t('Выборка'),
#variable_get('feed_item_length','full'),
'#options' => array(t('Другое')),
'#description' => t('Здесь хочу выбор'),
);
$form['dataS'] = array(
'#type' => 'textfield',
'#title' => t('С '),
'#size' => 25,
'#states' => array(
'visible' => array(
':input[name="compl_dr"]' => array('cheked' => TRUE),
),
),
);
так же. вроде все правильно.
может библиотеку какуюто подключить нужно...
не cheked ,а checked
*FacePalm* thx))