Uncheck All Checkbox on Page Load for Apex Page Using Javascript

1. Put the following javascript function at "Function and Global Variable Declaration" of page attributes.
 function UncheckAll(){ 
      var w = document.getElementsByTagName('input'); 
      for(var i = 0; i < w.length; i++){ 
        if(w[i].type=='checkbox'){ 
          w[i].checked = false; 
        }
      }
  } 
2. Create page dynamics
  Event: Page Load
  Condition: No Condition
  Action: Eecute Javascript Code
  Code: UncheckAll()
  
Locate and open the true event "Execute Javascript Code" of create dynamic action, check "Fire On Page Load"

No comments:

Post a Comment

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...