CodeIgniter Forums
checkbox color with select all not working - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: General Help (
+--- Thread: checkbox color with select all not working (/thread-71102.html)

checkbox color with select all not working - kvanaraj - 07-06-2018

I am having matrix type of checkboxes . want to add color for that.

my view
select all checkbox
<td align="center">
    <?php echo $rowe['subcode']; ?> <input type="checkbox" id="check-all2" onClick="toggle(this,<?php echo $rowe['markid']; ?>)" value="<?php echo $rowe['markid']; ?>" data-checkbox-class="icheckbox_square-blue">
with in box

<td align="center"> <input type="checkbox" name="friend_id[]" value="<?php echo $row1['markid'];?>_<?php echo $row['regno'];?>" >

checkbox color

<script src="<?php echo base_url(); ?>assets/js/addUser.js" type="text/javascript"></script>
<script src="<?= base_url('assets/plugins/iCheck/icheck.min.js') ?>"></script>
      $(function () {
          checkboxClass: 'icheckbox_square-green',
         //checkboxClass: 'icheckbox_square-blue',
         // radioClass: 'iradio_square-blue',
          increaseArea: '25%' // optional


select all
<script language="JavaScript">
  function toggle(source, markid) {
          checkboxes = document.getElementsByName(markid);
          for(var i=0, n=checkboxes.length;i<n;i++) {
              checkboxes[i].checked = source.checked;


how to add a color for that checkboxes and i select select_all for every row that corresponding data of checkboxes to be checked. how to implement this?