méthode jquery pour sélectionner au moins un élément pour un groupe de cases à cocher

< 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"></ label > 
</ div >
var checkboxObj = $ ("# stopStatus"). find ("input [type = checkbox]: check" );
 if (checkboxObj.size () == 0 ) { 
   dialog ( "Sélectionnez au moins un élément!", 0 )
    return  false ; 
   }

 

Je suppose que tu aimes

Origine www.cnblogs.com/firstcsharp/p/12700137.html
conseillé
Classement