jQuery UI Widgets Forums Plugins Validator, Drag & Drop, Sortable Bug report : Validator and IE8 (fix inside)

This topic contains 2 replies, has 2 voices, and was last updated by  Coloco 9 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Coloco
    Participant

    Hey,

    I found a bug with jqxValidator on IE8 (and perhaps newer versions of IE too).

    In the “rules” property, if you leave a period , at the end, it will throw an error as it seemingly tries to parse the last object (after the ,), which doesn’t exist.

    Error is at line 7, char 6325 of jqxvalidator.js.

    Exemple :

    $("#form").jqxValidator({
        rules:[
            { input: '#test1', message: "Test 1", action: 'keyup', rule: 'required' },
            { input: '#test2', message: "Test 2", action: 'keyup', rule: 'required' },
        ]
    });

    This will not work because of the last period after the test2 end bracket.

    This will work however :

    $("#form").jqxValidator({
        rules:[
            { input: '#test1', message: "Test 1", action: 'keyup', rule: 'required' },
            { input: '#test2', message: "Test 2", action: 'keyup', rule: 'required' }
        ]
    });

    You can also put a period after the ] just fine.

    I can confirm this is a bug because putting a period at the end worked for the columns property of jqxGrid for instance, and because it only happens on IE8.

    Have a nice day,
    Coloco.


    Dimitar
    Participant

    Hello Coloco,

    You are using invalid JavaScript syntax and the error thrown has nothing to do with a jqxValidator bug, but with Internet Explorer 8’s “sensitivity” to such syntax, i.e. trailing commas. For more information, please refer to the following Stack Overflow topic: http://stackoverflow.com/questions/19450114/get-trailing-commas-in-javascript-working-in-ie7-ie8.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    Coloco
    Participant

    Why doesn’t it throw an error with my jqxGrid on IE8 then ? Pretty weird indeed, I’ll remove the commas then

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.