0

this error message apears if I'm using the validationEngine in the Internet Explorer 8 (not tried other versions). in this message is written that the problem is at line 714, 4th character, where is this code:

if(!required && !(field.val()) && field.val().length < 1 && rules.indexOf("equals") < 0) options.isError = false;

I don't know where is the problem

koubin
  • 579
  • 5
  • 9
  • 30
  • Neither do we, because there is not enough information and what appears to be at the 4th character here ("`required`") is not a property access. You will have to do some basic debugging yourself and ask a question with more details. – Jon Aug 28 '13 at 13:37

1 Answers1

3

.indexOf isn't supported in <= IE8.

As a workaround you could create a custom indexOf() implementation, placed in perhaps a centralised JS script file targeted for IE8. For example,

// create self-invoking anonymous indexOf() function
(function () {
    if (!Array.prototype.indexOf) {
        Array.prototype.indexOf = function (obj, start) {
            for (var i = (start || 0), j = this.length; i < j; i++) {
                if (this[i] === obj) {
                    return i;
                }
            }
            return -1;
        };
    }
})();
Mark Erasmus
  • 2,305
  • 6
  • 25
  • 37
  • thats it. I found this function with some others [here](http://stackoverflow.com/questions/2790001/fixing-javascript-array-functions-in-internet-explorer-indexof-foreach-etc). many thanks – koubin Aug 28 '13 at 14:47