mardi 29 janvier 2019

How to get multiple checked checkbox values in codeigniter update from?

I want to get the multiple checked checkbox values

Here is my code:

<?php
      foreach ($dosage_form_list as $val) {
?>  

    <input type="checkbox" name="dosage_form_input[]" value="<?php echo $val['dosage_form']?>" <?php echo ($dosage_form_list_exist == $val['dosage_form'] ? 'checked' : ''); ?>>

    <?php echo $val['dosage_form'];?>

<?php

      }

?> 

Here $dosage_form_list_exist is get the multiple checkbox values. But My code shows only one item is checked. I want to show multiple checked values.

In Image-1. I get only one values to checked. And it's ok.

Image-1

But In Image-2. I get multiple values See Like Injection, Suspension, Tablet. But There are no checked checkboxes. Image-2

So That reason I want to get the multiple checked checkbox values.

Can anyone please help me for check this?




Aucun commentaire:

Enregistrer un commentaire