jzaefferer/jquery-validation — pull request #1140 by tractorcow (2014-06-03 03:30:03+00:00)
Title: core: Respect non-error aria-describedby

To follow up from my previous pull request at https://github.com/jzaefferer/jquery-validation/pull/1083 I've improved this solution to better respect existing aria-describedby that do not refer to error labels.

Previously jquery-validate would monopolise this field without regard for aria-describedby references which may point to valid descriptive elements related to the source field (such as captions, right titles, or so on).

It was pretty trivial to reduce the scope of errorsFor to select only error elements, and update showLabel to merge new error IDs with the existing aria-describedby rather than replacing it.