checkboxのバリデーションでcheckboxがチェックされてない時に全checkboxが赤でバリデーションされた表示されるようにしたいのですが現状最初のcheckboxだけが赤でバリデーションされた表示になっています。どこで間違えていますか?
誰か教えてくださいませ!!
現状は下記のようの最初のcheckboxだけが赤くなっていますが、全部のcheckboxを赤くなるようにしたいです。
下記はjqueryのソースコードです.補足:00xxxxxhhhhは他のシステムと連携するための使用しています。
<form action="" method="POST" id="contact_form" data-validate > <div> <table > <tbody> <tr class="radio"> <th><i>必須</i>radioチェック</th> <td> <span><label><input type="radio" id="00N0K00000xxxx" name="00N0K00000xxxx" class="inquiry"> <span>radio-1</span></label></span> <span><label><input type="radio" id="00N0K00000xxxx" name="00N0K00000xxxx" class="inquiry"> <span>radio-2</span></label></span> <span><label><input type="radio" id="00N0K00000xxxx" name="00N0K00000xxxx" class="inquiry"> <span>radio-3</span></label></span> <div id="radioinfo_error"></div> </td> </tr> <tr class="checkbox"> <th><i>必須</i><span>てすとチェック欄</span></th> <td > <span><label> <input type="checkbox" name="00xxxxxhhhh" id="00xxxxxhhhh" class="interesting"><span>test_1</span></label></span> <span><label> <input type="checkbox" name="00xxxxxhhhh" id="00xxxxxhhhh" class="interesting"><span>test_2</span></label></span> <span><label> <input type="checkbox" name="00xxxxxhhhh" id="00xxxxxhhhh" class="interesting"><span>test_3</span></label></span> <span><label> <input type="checkbox" name="00xxxxxhhhh" id="00xxxxxhhhh" class="interesting"><span>test_4</span></label></span> <span><label> <input type="checkbox" name="00xxxxxhhhh" id="00xxxxxhhhh" class="interesting"><span>test_5</span></label></span> <span><label> <input type="checkbox" name="00xxxxxhhhh" id="00xxxxxhhhh" class="interesting"><span>test_6</span></label></span> <div id="checkboxservice_error"></div> </td> </tr> </tbody> </table > </div> </form> <script> jQuery(function($){ $("#contact_form").validate({ rules : { "00xxxxxhhhh": { required: true }, "00N0K00000xxxx": { required: true }, }, messages: { "00N0K00000xxxx" :{ required: "必須項目です。" }, "00xxxxxhhhh" :{ required: "必須項目です。" }, }, errorPlacement: function(error, element) { if(element.attr("name")=="00N0K00000xxxx") { error.insertAfter("#radioinfo_error"); } else if(element.attr("name")=="00xxxxxhhhh") { error.insertAfter("#checkboxservice_error"); } else{ error.insertAfter(element); } } }); }); </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.16.0/jquery.validate.js "></script>
エラー表示以前にid="contact_form"やjQueryの読み込みなどが
記述されていないコード自体がおかしいので修正が必要です。
idやname属性がすべて00xxxxxhhhhになっているのも
おかしいので修正が必要です。

@yasutomi
指摘ありがとうございます。
id="contact_form"は追加しました。
dやname属性がすべて00xxxxxhhhhになっているのは他のシステムと連携するために使っていますので属性は正しいです。
同じidの値が何度も出現しているということでしょうか?
idは同じ文書内で1ヵ所にだけ使用できて重複させてはならないので
属性の使い方は間違っています。

それぞれのidの値を違う値にしても同じエラーが出ます。
#contact_formなのにid="contact-form"になっていたり
jQueryがコード上で読み込まれていなかったり
不備が多いので全体をよく確認してからコードの投稿をお願いします。

#contact_formは書き込みのミスでした。

checkboxの前にradioチェックありますがradioの方が全部正しくエラー表示されています。
