I'm trying to use #states in form api to change the title of a fieldset based on his collapsed states.
so far here's my code :
$form['advanced'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced search'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#attributes' => array('class' => array('search-advanced', 'clearfix')),
'#states' => array(
'#title' => array(
array('fieldset#edit-advanced' => array('#collapsed' => 'Hide advanced search')),
),
),
);
I've tried different things, but without success.
Thanks a lot.