form #states not working with literal integers as values in IE8


Solution –

// should get displayed based on selection on ‘principal’

$form[‘dependant’] = array(
‘#type’ => ‘textfield’,
‘#title’ => ‘Dependant’,
‘#states’ => array(
‘visible’ => array(
// (1) works with this, because a explicit string “1” is passed: ‘:input[name=”principal”]’ => array(‘value’ => “1”),
‘:input[name=”principal”]’ => array(‘value’ => 1), // doesn’t work in IE8
),
),
);

Ref – https://drupal.org/node/1962800

Advertisements
  1. Leave a comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: