Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Apr 2010 at 14:14 UTC
Updated:
11 May 2010 at 17:12 UTC
Issue #667944: Javascript #states cannot hide fieldsets, radios, checkboxes does not fix the #states property for fieldsets.
The following code does not hide fieldsets, but it hides the textfield.
$conditions = array(
'visible' => array( ':input[#edit-myradios]' => array('checked' => true) )
);
// radio buttons control visibility of other elements
$form['myradios'] = array(
'#type' => 'radios',
'#title' => '',
'#options' => array( 'new' => t('New'), 'existing' => t('Existing') )
);
// sample textfield that shows/hides based on myradios state.
$form['mytextfield'] = array(
'#type' => 'textfield',
'#title' => 'My Textfield',
'#states' => $conditions
);
$form['myfieldset'] = array(
'#type' => 'fieldset',
'#title' => 'My fieldset',
'#states' => $conditions
);
Comments
Comment #1
cwgordon7 commentedDuplicate of #767212: #states can't hide/show fieldsets.
Comment #2
aspilicious commentedOther one is fixed