
  <ul>
                                <?php 
                                 $count=array();
                            
                                foreach ($popular_quiz_topic as $value) { ?>
                                   <div class="checkbox checkbox-success">
                                    <input id="checkbox2" name="checkbox2[]" class="styled" onclick="CategorywiseQuiz()" value="<?php echo $value->topic_id;?>" type="checkbox"><label for="checkbox1"><?php echo $value-> topic_name; ?></label><br/>
                                </div>
                                    <?php 
                                 $count[]=$value->topic_id;
                                } ?>
                                <li id="moreL">
                                    <a href="javascript:;" onclick="more_view_popular_qize('<?php echo  $number_popular+3;?>');" style="padding-left: 40px">
                                        <?php if($number_popular<=count($count)) { ?>
                                        More....
                                         <?php }
                                        ?>
                                    </a>
                                </li>
                            </ul>
<script>
 function CategorywiseQuiz(){
      var xmlhttp2  ;
      xmlhttp2 = AjaxInitialization(xmlhttp2);
       var vals = [];
       
  $(document).ready(function(){
$('input:checkbox[name="checkbox2[]"]').each(function() {
    if (this.checked) {
        vals.push(this.value);
    }
});

 
});
   var topic_id=vals;
   var url='<?php echo base_url(); ?>'+'select-category-wise-quiz';
       
        var formdata = new FormData();
        formdata.append("topic_id",topic_id);
        xmlhttp2.addEventListener("load", function () {
           // alert(xmlhttp2.responseText);
        document.getElementById('cat_quiz').innerHTML =xmlhttp2.responseText;
      
           
                
           
            }, false);
            xmlhttp2.addEventListener("error", function () {
                alert("not upload");
            }, false);
            xmlhttp2.addEventListener("abort", function () {
                alert("Aborted");
            }, false);

            xmlhttp2.open("POST", url);
            xmlhttp2.send(formdata);
}   
 </script>