I am trying to disable a date field’s second value, inside a field collection, but it isn’t working.
My hook_form_alter has this:
$form['field_certification']['und'][0]['field_validity']['und'][0]['#states'] = array( 'disabled' => array( 'input[name="field_certification[und][0][field_auto_calculate_validity][und]"]' => array('checked' => TRUE), ), );
The HTML for the date field is here:
<input class="date-clear form-text hasDatepicker date-popup-init" type="text" id="edit-field-certification-und-0-field-validity-und-0-value2-datepicker-popup-0" name="field_certification[und][0][field_validity][und][0][value2][date]" value="07/23/2014" size="20" maxlength="30">
The checkbox is here:
<input type="checkbox" id="edit-field-certification-und-0-field-auto-calculate-validity-und" name="field_certification[und][0][field_auto_calculate_validity][und]" value="1" class="form-checkbox">
Could it be because I’m not specifically selecting the (second) value of the date field?