{"action":"closed","issue":{"url":"https://api.github.com/repos/jzaefferer/jquery-validation/issues/765","labels_url":"https://api.github.com/repos/jzaefferer/jquery-validation/issues/765/labels{/name}","comments_url":"https://api.github.com/repos/jzaefferer/jquery-validation/issues/765/comments","events_url":"https://api.github.com/repos/jzaefferer/jquery-validation/issues/765/events","html_url":"https://github.com/jzaefferer/jquery-validation/issues/765","id":15084683,"number":765,"title":"cannot update invalidHandler after initialization","user":{"login":"iamandycohen","id":812671,"avatar_url":"https://avatars.githubusercontent.com/u/812671?v=3","gravatar_id":"","url":"https://api.github.com/users/iamandycohen","html_url":"https://github.com/iamandycohen","followers_url":"https://api.github.com/users/iamandycohen/followers","following_url":"https://api.github.com/users/iamandycohen/following{/other_user}","gists_url":"https://api.github.com/users/iamandycohen/gists{/gist_id}","starred_url":"https://api.github.com/users/iamandycohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamandycohen/subscriptions","organizations_url":"https://api.github.com/users/iamandycohen/orgs","repos_url":"https://api.github.com/users/iamandycohen/repos","events_url":"https://api.github.com/users/iamandycohen/events{/privacy}","received_events_url":"https://api.github.com/users/iamandycohen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2013-06-03T19:37:07Z","updated_at":"2015-06-26T16:40:50Z","closed_at":"2015-06-26T16:40:50Z","body":"If you update the invalidHandler after initialization, the original event handler will always fire.  This is because of the way that invalidHandler is set up.\r\n\r\nThis is in jquery.validate:\r\n```js\r\n\t\t\tif ( this.settings.invalidHandler ) {\r\n\t\t\t\t$(this.currentForm).bind(\"invalid-form.validate\", this.settings.invalidHandler);\r\n\t\t\t}\r\n```\r\nThe way around this is to update the event handler:\r\n```js\r\n            $form.off('invalid-form.validate')\r\n                .on('invalid-form.validate', newInvalidHandler);\r\n```"}}