forked from jquery-validation/jquery-validation
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed jquery-validation#177 - Fix validation of a single radio or che…
…ckbox input 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>
- Loading branch information
Showing
3 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters