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

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -