-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Error: Syntax error, unrecognized expression: label[for='days[]'], label[for='days[]'] *, #days[]-error #1504
Comments
I can't reproduce this. Can you test with the code in master in this git repository? At testpage that shows the issue would also help. I can then reopen if it persists. |
Thank you, but I already solved the problem. :) |
Hi Albert28, I'm having the exact same problem. Do you remember how you fixed this? |
Hi, vierkantemeter. Notice I changed "days[]" to simply "days" in HTML and Javascript. <div class="checkbox-list">
<input type="checkbox" class="days" name="days" />Mon
<input type="checkbox" class="days" name="days" />Tue
<input type="checkbox" class="days" name="days" />Wed
</div> jQuery.validator.addMethod("atLeastOneChecked",function(value, element, params) {
var selectedDays=($('.days:checked').size());
return (selectedDays >0);
}, "Please, select one day at least"); rules: {
days: { //this references input[name=days]!
atLeastOneChecked: true
}
} |
Thank you Albert!
|
Fixed with c604e51 |
Hi :D, the first time I validate if, at least, there is one checkbox selected, the form validator works ok. Nonetheless, the second time I keep getting this error no matter if the checkbox is selected or not.
Uncaught Error: Syntax error, unrecognized expression: label[for='days[]'], label[for='days[]'] *, #days[]-error
Here's my HTML:
Here's my Javascript inside form.validate
And here's my Javascript inside jQuery.validator.addMethod
The text was updated successfully, but these errors were encountered: