我需要强制用户检查至少一个带有欧芹的不同名称的复选框。
使用相同的名称:
<label for="hobbies">Hobbies:</label>
<p>
Skiing <input name="hobbies[]" id="hobby1" value="ski" data-parsley-required type="checkbox"><br>
Running <input name="hobbies[]" id="hobby2" value="run" type="checkbox"><br>
Eating <input name="hobbies[]" id="hobby3" value="eat" type="checkbox"><br>
Sleeping <input name="hobbies[]" id="hobby4" value="sleep" type="checkbox"><br>
Reading <input name="hobbies[]" id="hobby5" value="read" type="checkbox"><br>
Coding <input name="hobbies[]" id="hobby6" value="code" type="checkbox"><br>
</p>
但是名字不同,它没有:
<label for="hobbies">Hobbies :</label>
<p>
Skiing <input name="hobbies1" id="hobby1" value="ski" data-parsley-required type="checkbox"><br>
Running <input name="hobbies2" id="hobby2" value="run" type="checkbox"><br>
Eating <input name="hobbies3" id="hobby3" value="eat" type="checkbox"><br>
Sleeping <input name="hobbies4" id="hobby4" value="sleep" type="checkbox"><br>
Reading <input name="hobbies5" id="hobby5" value="read" type="checkbox"><br>
Coding <input name="hobbies6" id="hobby6" value="code" type="checkbox"><br>
</p>
有没有办法用data-parsley-group或其他东西来管理它?
注意:输入列表可以很长