jzaefferer/jquery-validation — pull request #803 by sergioxs (2013-06-29 23:42:10+00:00)
Title: FIX to remove error class from elements with "depends" rule when rule does not apply anymore

Error class is not removed from elements with "depends" rules when rule does not apply anymore.

You can check what I mean looking at http://jsfiddle.net/NTvPM/. If you submit the form with checkbox checked both inputs go red. Next you uncheck the checkbox and submit again and second error message dissapears but the input still has red border because error class is still there.

I changed normalizeRules to call unhighlight if the rule is going to be deleted and the element has the error class assigned. Not sure if it's the best way to solve this.