2013-04-11 80 views
0

我有一個表單中的複選框,我使用jquery validation.Here錯誤消息顯示在複選框下方,錯誤後顯示覆選框的標籤。錯誤放置複選框

我需要在複選框標籤後面顯示錯誤消息。 這裏是我的代碼:

<li> 
    <input type="checkbox" name="toc"><span name="toc"> &nbsp;&nbsp;I agree to the terms and conditions 
         </span> 
    </input> 
</li> 
<br> 
<li> 
    <label style="margin-top:20px;display:none" name="toc" class="error">This field is required</label> 
</li> 

該窗體的jQuery是

$(document).ready(function() { 
    $('#form').validate({ 
     rules: { 
      toc: { 
       required: true 
      } 
     } 
    }); 

回答

1

不能放在輸入標籤的任何標記(元素)。