CodeIgniter Forums

Full Version: checkbox color with select all not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?