チェックボックスのグループに対して少なくとも1つの項目を選択するjqueryメソッド

< div class = "form-input" id = "stopStatus" > 
  < label > < input type = "checkbox" name = "SSStatus" id = "SSStatus" ></ label > 
  < label > < input type = "checkbox " name =" SGStatus " id =" SGStatus " ></ label > 
  < label > < input type =" checkbox "name = "PFStatus" id = "PFStatus"></ ラベル> 
</ div >
var checkboxObj = $( "#stopStatus")。find( "input [type = checkbox]:checked" );
 if(checkboxObj.size()== 0 ){ 
   dialog( "Select least one item!"、0 return  false ; 
   }

 

おすすめ

転載: www.cnblogs.com/firstcsharp/p/12700137.html