mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-20 09:11:40 +01:00
The validator element() method delegates to check(). When check() is passed a radio or checkbox input element (call it 'A'), it instead checks the first element with the same name in the form (call it 'B'). If element B is judged invalid, a bug occurs. Element A will have been added to the currentElements array, but element B is what is added to the errorList. So, when showErrors is called, element A will be in validElements(), and will be unhighlighted. This is fixed by having element() also change its target to be the first element of the same name when passed a checkbox or radio input. Signed-off-by: Eric Naeseth <eric@thumbtack.com>
37 KiB
37 KiB