Selector for input checkboxes Drupal 7

54 Views Asked by At

I am trying to hide a field based on what user is selecting from a entity referenced checkbox list but no matter what I do I cannot hide the field.

I think some issue with the selector.

 $form['title']['#states']['invisible'][] = array(
  'input[name="field_offering_course[und][0][target_id]"' =>array('checked' => TRUE));

Attached is the view source for the checkbox

1

There are 1 best solutions below

0
Chris Happy On

You are missing a bracket:

'input[name="field_offering_course[und][0][target_id]"]' =>array('checked' => TRUE));

I can't help more than that...not very experienced in php :D