After fixing Ajax issues mentioned here https://drupal.org/node/2245331 this is an error I am getting on IE8:

Clientside Validation error.

Before that JavaScript parser didn't even go to this one.
This happens when ajax_el is having bind value.

A quick path goes below.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Turek’s picture

Path that worked for me - for 7.x-dev version.

Turek’s picture

Component: Code » Webform Validation
attiks’s picture

+++ b/clientside_validation.js
@@ -1416,7 +1416,13 @@
+        if (typeof Drupal.ajax[ajax_el].options == undefined) {

Don't you mean !=

Turek’s picture

Yes, you are right, and quotes around undefined :)
Thanks for a quick response.

attiks’s picture

+++ b/clientside_validation-ie8-fix-2279537-1.patch
@@ -0,0 +1,19 @@
+diff --git a/clientside_validation.js b/clientside_validation.js
+index 2268dc5..f78c449 100644
+--- a/clientside_validation.js
++++ b/clientside_validation.js
+@@ -1416,7 +1416,13 @@
+   Drupal.behaviors.ZZZClientsideValidation = {
+     attach: function () {
+       function changeAjax(ajax_el) {
+-        var origBeforeSubmit = Drupal.ajax[ajax_el].options.beforeSubmit;
++        var origBeforeSubmit;
++        if (typeof Drupal.ajax[ajax_el].options == undefined) {
++          origBeforeSubmit = Drupal.ajax[ajax_el].options.beforeSubmit;
++        }
++        else {
++          Drupal.ajax[ajax_el].options = {};
++        }
+         Drupal.ajax[ajax_el].options.beforeSubmit = function (form_values, element, options) {
+           var ret = origBeforeSubmit(form_values, element, options);
+           // If this function didn't return anything, just set the return value to true.
diff --git a/clientside_validation.js b/clientside_validation.js

did you add this block by accident, this was removed because it was causing problems

Turek’s picture

Actually this was added by git diff. I've seen it in some patches already, and thought it would be ok.
That top part is obviously not needed.

Turek’s picture

This is a correct one.

alex-mo’s picture

I think the problem lies within call of function changeAjax(), not in the function itself (of course: you can always add some ifs :), but this would be working around the problem, I guess).

changeAjax gets called on line 1385 with ajax_el being 'bind' and this no identifier in the DOM (as it should), but a property name coming from the prototype of Drupal.ajax. IE 8 seems to be more picky when it comes to iterating over or when evaluating these (other browsers don't seem to be startled by this...) . Catching this with hasOwnProperty() does the trick for us.

Patch attach.

Jelle_S’s picture

Status: Needs review » Fixed

Fixed in the latest dev version. Thanks for the patch!

  • Jelle_S committed 5fc4042 on 7.x-1.x authored by alex-mo
    Issue #2279537 by Turek, alex-mo: Fixed IE8: Unable to get property '...

  • Jelle_S committed 5fc4042 on 7.x-2.x authored by alex-mo
    Issue #2279537 by Turek, alex-mo: Fixed IE8: Unable to get property '...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.