Has anyone else run across this issue. I'm working in Drupal 7. I've added several Dependent fields. They work fine in Firefox, Chrome, Safari...but they don't open as expected in IE. Any ideas?

Members fund testing for the Drupal project. Drupal Association Learn more


sweimer’s picture

This might help. As I looked closer, I realized the Dependee field is a multi-selection list. The field is "Add Media" with options like "Add Audio" and "Add Image" ect. The field is set so more than one option can be selected. The Selected options then open media upload fields (for example...if "Add Audio" is selected, an "Audio Upload" field then appears.)

I'm guessing that allowing multiple selections on this dependee is the issue in IE since I have several other dependent fields that are not multi-select fields that are working fine in this same Content Type in IE

letsgokrogoling’s picture

I'm currently having the same issue; multi-select list, and two other dependent fields are shown and hidden based on which values are selected. It works fine in Firefox and Chrome, but not in Internet Explorer.

Has anyone else run into this?

jeff h’s picture

Yep; unlike your situations though this is happening for me with a drop-down list as the trigger field (ie the dependee). Works perfectly almost everywhere, even IE9. The problem is in IE 8 and earlier (I tested 7, didn't test 6).

The error I get in IE8's Console is:

SCRIPT65535: Unexpected call to method or property access.
jquery.js?v=1.4.4, line 114 character 479
jeff h’s picture

Status: Active » Closed (fixed)

I put a console.trace() at the right moment in jQuery itself and discovered that (in my case at least) this whole problem arose because of a different module entirely! For me it was the Field Group module (http://drupal.org/project/field_group) and there is an issue over there (http://drupal.org/node/1793184) that describes similar problems to this issue, and a solution.

The quickest fix for me was simply to upgrade from Field Group 7.x.1-1 to 7.x-1.x-dev. My Dependent Field problem vanished and everything works perfectly in IE 7+ (didn't test in 6 or earlier).

Even if your problem isn't due to Field Group, be very suspicious of any other javascripty modules you might have doing things on the same page. Check their issue queues for IE problems as well.

I'd be very interested to know if the two earlier posters on this issue had Field Group on the same page. I'm going to close this issue in the assumption they did, but please re-open it if you didn't.

dafeder’s picture

Issue summary: View changes
Status: Closed (fixed) » Active

I am having this issue in IE9 and it doesn't seem to be related to fieldgroup. It's not producing a Javascript error in the console, but no dependent fields display for me at all in IE9. I got some insight by reading this:


I added a line of code at the end of conditional_fields_form_after_build() that re-sets the value in one of the #states arrays to be a string:

$form['field_search_zip']['#states']['visible']['[name="field_search_by[und]"]']['value'] = "0";

This makes it work in IE with no ill effects on Chrome. I'm a little mystified though why this doesn't happen for everyone... I assume there would be a lot more discussion around this if it happened on every site. I'm going to write a patch that will do this for all dependee fields but I don't quite understand what's going on here.

dafeder’s picture

Status: Active » Needs review
1.19 KB
PASSED: [[SimpleTest]]: [MySQL] 160 pass(es). View

Here is a patch that makes conditional fields work for me in IE9 by casting values as strings.

MrDaleSmith’s picture

1.32 KB
PASSED: [[SimpleTest]]: [MySQL] 160 pass(es). View

Ran into the same IE9 issue and the patch in #7 nearly worked - there was one extra value that needed to be cast as a string.

Have patched against 7.x-3.x branch - apologies if it's not correct: my first patch. Aw! Bless!

MrDaleSmith’s picture

Sorry - seem to have hidden the previous patch.

Jax’s picture

#7 worked for me too. Issue in IE11 with radios.

scott.whittaker’s picture

I ran into the same issue, using a "one of these values" from a list of options. As we only allow one value to be selected (radio buttons) rather than multiple values (checkboxes) I resolved the issue locally by changing my rules to use "has only one of the values" instead of "has any of these values". Of course it would be better for this patch to be rolled in so you don't need to do that, but this is a workable solution that doesn't require a patch.

huteb’s picture

Status: Needs review » Reviewed & tested by the community

#7 works for me too. I tried using only the "one of these values" option, which worked but not consistently (for a strange reason I could get it to work on my dev environnement but not on the staging server...). With the patch it works fine.

gachan’s picture

It also works fine for me.

Thank you.

ndf’s picture

1.55 KB
PASSED: [[SimpleTest]]: [MySQL] 160 pass(es). View

We needed to combine patches #6 and #7 and that worked in IE 11.

Attached patch applies to 7.x-3.x .

Edit: for clarity, attached patch (#13) is the combined patch of #6 and #7.

ndf’s picture

bisw’s picture

I have combined both patch #6 and #7 and it works fine for me.

peterpoe’s picture

Status: Reviewed & tested by the community » Needs work

Sadly, values can be arrays, we can't just cast them as strings like this.

Anybody’s picture

Well this problem still exists and breaks even the latest version of IE. The dependent fields will never show up there. That's why I'll set up the priority.

As stated out in #16 the patched above don't work for multiple value fields which breaks functionality even more...

Use "has only one of the values" as written in #10.

Anybody’s picture

I've had a look at this and finally I'd suggest the following:

1. This bug should be fixed at FAPI #states directly, see #1962800: form #states not working with literal integers as values in IE!

2. Furthermore the patch above is nearly complete, if you need a quickfix you should use the following for the values array:

elseif ($options['values_set'] == CONDITIONAL_FIELDS_DEPENDENCY_VALUES_AND) {
          if (count($options['values'] > 1)) {
            foreach ($options['values'] as $tmpkey => $tmpvalue) {
              $options['values'][$tmpkey] = (string) $tmpvalue;
          $values[$options['condition']] = count($options['values']) == 1 ? $options['values'][0] : $options['values'];

If someone would like to, please create a final patch from that if the module maintainer will not wait for the problem to be fixed in core (which issue is open since 2 years!)

rramos’s picture


I apply path #13 to current dev version with using Drupal 7.36 and show following Notice:

Notice: Array to string conversion en conditional_fields_form_after_build() (línea 507 de /home/acuabit/public_html/desarrollo/cpumps/sites/all/modules/conditional_fields/conditional_fields.module).

This is the code of this lines:

elseif ($options['values_set'] == CONDITIONAL_FIELDS_DEPENDENCY_VALUES_REGEX) {
          $values[$options['condition']] = (string) $options['value'];

Can anybody help me??

Status: Needs work » Needs review
rv0’s picture

1.5 KB
PASSED: [[SimpleTest]]: [MySQL] 160 pass(es). View

New patch (based on comments in #6, #7, #13, #18 and #19)

There's no point in casting a regex to string, so removed that. (it's actually an array with RegExp => $regex)

Seems to work fine in all cases here. Please post additional info if it doesn't work for you.

niallmurphy-ie’s picture

Changing to "only has one value" and applying the patch in #13 or #21 doesn't do anything to help.. Dependent fields won't show in IE 11.

Edit: Changing the dependee so that it could only have one value did the trick. It was set to unlimited. Happy days.

rv0’s picture

Is it possible to provide more info? Which type of fields, how the dependency was configured, ...
Also, are you sure caching was not the problem?

niallmurphy-ie’s picture

After playing with it more, I realise that the patch wasn't needed.. Allowing unlimited values on the field broke it in IE 11. Changing the dependee (St Category in the screenshot) to "one" fixed the issue. I'm back on alpha2 now with no patch and it's working.


rv0’s picture

Priority: Normal » Major

Ok, so your problem is unrelated.

This module not working in IE seems like a major problem though.

Markoz’s picture

Issue still open on IE11 when multiple values are allowed

peterpoe’s picture

Status: Needs review » Closed (duplicate)
merlin06’s picture


merlin06’s picture

Notice: Array to string conversion in conditional_fields_form_after_build() (line 504 of /conditional_fields/conditional_fields.module).
A small fix for patch #21.

Gik000’s picture

#29 worked

thank you

WorldFallz’s picture

here's up updated patch that contains both 21 and 29.

Shefarik’s picture

Status: Closed (duplicate) » Needs review

Worked for me in IE 11. Need updating module with last patch

Shefarik’s picture

Status: Needs review » Patch (to be ported)
le72’s picture

Priority: Major » Critical

Change to critical, as it is not working on IE at all.
The patch resolves the issue.

lephleg’s picture

Is this going to be ported soon? I'd like to use it on production.

Albert Volkman’s picture

It appears to already be ported, just not merged. You can add the patch via your Composer manifest (or whatever you're using for doing your builds).

TravisJohnston’s picture

#31 works for me only if I also patch the states.js file from this patch. https://www.drupal.org/node/1962800#comment-11200137

nagy.balint’s picture

I ran into the same bug.

The patch works fine for me.