I am building a form using field groups and one section is set up like so:
hook_field_group_build_pre_render_alter (&$element) {
// An array of all accepted majors
$majors = majors();
// Groups will show only if the user selects 'ohio' and certain majors from $major array.
$element['group_college']['group_majors']['#states'] = array (
'visible' => array (
':input[name="field_majors[und]"]' => array ( $majors, ),
':input[name="field_campus[und]"]' => array (
array ('value' => t('ohio')),
),
),
'required' => array (
':input[name="field_majors[und]"]' => array ( $majors, ),
':input[name="field_campus[und]"]' => array (
array ('value' => t('ohio')),
),
),
'enabled' => array (
':input[name="field_majors[und]"]' => array ( $majors, ),
':input[name="field_campus[und]"]' => array (
array ('value' => t('ohio')),
),
),
);
}
When the user selects certain values from a dropdown selection and the radio value is 'ohio' they will see a collection of fields to fill out. This is successful the first time. However, when if the user were to re-select another value from $major
, the collection of fields will not reload/disappear.
This will work only if I use one :input
, but these fields are contingent on both conditions being true.
Any suggestions?
Closed: won't fix
1.0
Miscellaneous
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.