php - Send the id of a selected option value to the controller -


i have select option witch contains labels selected database!

my problem don't want send value of label, want send id.

here code :

<div class="form-group">                  <h3>veuillez choisir un cycle :</h3><br/>                    <label>cycle: </label>                    <form method="post" accept-charset="utf-8" action="<?php echo site_url("filiere/filiere_add"); ?>">                   <select name="cyc" id ="select1" class="input-small">                      <?php foreach($cycle $row) {?>                           <option><?php echo $row->libelle; ?></option>                      <?php }?>                 </select>                   </form>                    <button class="btn btn-success" onclick="display()"><i class="glyphicon glyphicon-plus"></i> display</button>                 </div> 

the table contains id , libelle , want display libelle in select option form want send id controller!

thank you.

this is, how should send id's controller:

<option value="<?php echo $row->id; ?>"><?php echo $row->libelle; ?></option> 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -