I am new to codeigniter. I wanted to know how to get checkbox values which are checked .I went through various answers but couldnt solve.
I am displaying the values from database table as checkbox values.
My view code for checkbox :
<?php foreach($g->result() as $grp)
{ ?>
<input type="checkbox" name="mycheck[]" value="<?php echo $grp->group_id; ?>" <?php echo set_checkbox('mycheck', '$grp->group_id;' ); ?> /> <?php echo $grp->group_name; ?>
I don not know how to get only the checked value(that is the group_id) in controller as well as in model to insert it into another tabel in database..
Please help.
Aucun commentaire:
Enregistrer un commentaire