php - Getting the selected drop down value in codeigniter -


i want selected value drop down list variable. loading drop down list values database initially. inside view file,

           <select name="trackerid" style="height:30px; width:140px";>            <?php foreach ($imei $row):             {                   echo "<option value=\"trackerid\">" . $row['imie'] . "</option>";             }             endforeach; ?>            </select>  

with above code, able load imei numbers database. when click submit button, want send selected imei database. in controller file,

          $newconfarray["imie"] = $this->input->post("trackerid"); 

but when write simple var_dump test, returns bool(false).

         var_dump(  $newconfarray["imie"]);  

i want selected imei view file. how it? suggestions highly appreciated.

you have not put value in option try this

echo "<option value='".$row['imie']."'>" . $row['imie'] . "</option>"; 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -