相关疑难解决方法(0)

jQuery Validation插件errorPlacement for checkbox

我使用jQuery Validation插件来验证我的表单.我的问题是复选框的错误消息的位置.请看这个图像:

在此输入图像描述

这是与复选框+ jQuery验证相关的html部分:

<fieldset id = "q8"> <legend class="Q8"></legend>
<label> What are your favourite genres of movies?<span>*</span></label>
<div class="fieldset content"> 

<style type="text/css">
 .checkbox-grid li {
 display: block;
 float: left;
 width: 25%;
}     
</style>

<ul class="checkbox-grid">
<li><input type="checkbox" name="q8[]" value="Action"><label for="checkgenre[]">Action</label></li>
<li><input type="checkbox" name="q8[]" value="Adventure"><label for="checkgenre[]">Adventure</label></li>
<li><input type="checkbox" name="q8[]" value="Comedy"><label for="checkgenre[]">Comedy</label></li>
<li><input type="checkbox" name="q8[]" value="Animation"><label for="checkgenre[]">Animation</label></li>
<li><input type="checkbox" name="q8[]" value="Drama"><label for="checkgenre[]">Drama</label></li> 
<li><input type="checkbox" name="q8[]" value="Romance"><label for="checkgenre[]">Romance</label></li>
  //Continued the same for OTHER CHECKBOXES 

</div>
</fieldset>

  //html for other questions...

 <input class="mainForm" …
Run Code Online (Sandbox Code Playgroud)

checkbox jquery jquery-validate errorplacement

13
推荐指数
1
解决办法
3万
查看次数