I've got one radios
element:
$form['trip_radios'] = array(
'#type' => 'radios',
'#options' => array(
'new' => t('Create a new trip'),
'existing' => t('Use an existing trip'),
)
);
I've got some #states
prepared:
$trip_states = array(
'visible' => array(
':input[name="trip_radios"]' => array(
'value' => 'new'
)
)
);
And some other elements that use $trip_states
for their #states
:
$form['itinerary_radios'] = array(
'#type' => 'radios',
'#options' => array(
'new' => t('Create a new itinerary'),
'existing' => t('Use an existing itinerary'),
),
'#states' => $trip_states
);
$form['title'] = array(
'#type' => 'textfield',
'#title' => 'Itinerary name',
'#required' => FALSE,
'#states' => $trip_states
);
The title
form element (and many others) properly listens to the #states
condition and works just fine. However, itinerary_radios
always shows up no matter what (if anything) is checked on trip_radios
. Why does a visible condition on a radios element's #states not listen to another radios value?