javascript - jQuery Validation invalidHandler not called -


i'm using jquery validation plugin. when submission invalid, invalidhandler callback not getting called.

$j('#my_form').validate({     errorclass: 'fielderror',     onkeyup: false,     rules: {         ...     },     messages: {         ...     },     invalidhandler: function () {         console.log('invalidhandler');     }, }); 

reorder options object invalidhandler first.

this shouldn't change behavior because according ecmascript standard, object properties have no order. browsers maintain order of object properties anyway, plugin must using object in non-standard way. solution found here.

$j('#my_form').validate({     invalidhandler: function () {         console.log('invalidhandler');     },     errorclass: 'fielderror',     onkeyup: false,     rules: {         ...     },     messages: {         ...     }, }); 

Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -