5

I am using #states form API to do the show hide animation of one element based on the values of another form element.like follows,

$price['#states'] = array(
    'visible' => array(
        ':input[id="edit-field-paid-event-und"]' => array('value' => 1),
    ),
);

It's working fine in all the browsers except in Internet explorer 9 and 10. Any solution for this.

17

I found the answer from this Link. So Internet Explorers never accepts element value as integer. I changed my code as follows it's working for me,

$price['#states'] = array(
  'visible' => array(
    ':input[id="edit-field-paid-event-und"]' => array('value' => '1'),
  ),
);
  • I was using a function to set the value and was able to use this answer and (string) to fix IE11. – DrCord Oct 29 '14 at 23:28
  • WTF! Damn IE. Thanks a lot for sharing the solution. Saved me lots of headaches. – Елин Й. Feb 21 '18 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.