Saturday, July 1, 2017

How to Check Whether All Check Boxes Selected Or Not in Visual Force Page Using Jquery

In my previous post we have discussed about how to check whether at least one check box is checked or not in visual force it's very easy using Jquery .In this post we are going to know about how to check whether all check boxes has selected or not? using Jquery .Please use the below code snippet to check this functionality.

Sample Source Code:


function selectionCheck(selClass)
   {
          
     var chbxClass = '.'+selClass; // selClass is styleclass name for all your checkbox
  
 if ($(chbxClass+':checked').length == $(chbxClass).length) 
        {
        
          alert('You have selected all records for Action'));           
            
        }
  
 else
 {
  alert('You haven't selected all records'); 
 }
     
  }



Thanks for visiting..hope this helps you!

No comments: