zaneray / scrupulous

Simple inline form validation using HTML5 attributes that plays nicely with Bootstrap
GNU General Public License v2.0
13 stars 4 forks source link

Ensure that error messages disappear from grouped radio buttons after… #13

Closed tylerrzaneray closed 3 years ago

tylerrzaneray commented 3 years ago

On covercraft we ran into an issue with required radio buttons where once an error message appeared, it would not go away.

The function to initially validate radio/checkbox inputs is passed a reference to the input. This allows the validation function to get attributes such as name and value for the element.

The function for re-validating radio/checkbox inputs was being passed something else which caused the console error TypeError: undefined is not an object (evaluating 'el.name'). To rectify this issue, the function for re-validating radio/checkbox inputs now receives a reference to the input.