クライアント側で検証したいフォームがあり、タスクに jQuery Validate を使用しています。検証は他の (入力) フィールドでは機能しますが、チェックボックスでは機能しません。
私は何を間違っていますか?
<form name="insert_new_lesson" id="insert_new_lesson" method="post" action="" class="lesson-form" enctype="multipart/form-data" novalidate="novalidate">
<input class="{category: true}" type="checkbox" name="category[]" value="15" id="grade15">
... rest of the fields...
$("#insert_new_lesson").validate({
errorPlacement: function (error, element) {
error.insertBefore(element);
},
rules: {
category: {
required: 'input[type="checkbox"]:checked',
},
...rest of the fields (validation works)