checkbox color with select all not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: checkbox color with select all not working (/showthread.php?tid=71102) |
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"> </td> ----------------------------------------------------------------------------------------- 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> <script> $(function () { $('input').iCheck({ checkboxClass: 'icheckbox_square-green', //checkboxClass: 'icheckbox_square-blue', // radioClass: 'iradio_square-blue', increaseArea: '25%' // optional }); }); </script> 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; } } </script> 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? |