• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DISREGARD / CANT DELETE A POST?? | form_dropdown selected working but not showing as selected in view to user.

#1
[eluser]uber_n00b[/eluser]
SEEMS TO BE WORKING ALL OF A SUDDEN??? PLEASE DISREGARD OR DELETE POST.

In my view I build a dropdown via:

Code:
<?php
      $selected =  ($this->form_validation->set_value('company')?$this->form_validation->set_value('company'):$company);
      echo form_dropdown('company', $company_drop, $selected);
?>

Which generates the correct <select> with the correct option selected in the html markup it generates.

Code:
<select name="company">
   <option value="">Select Company</option>
   <option selected="selected" value="3">Company 3</option>
   <option value="2">Company 2</option>
   <option value="1">Company 1</option>
</select>

The issue is that even though Company 3 option has the selected="selected" it displays as if nothing is marked as selected so it shows the first option. Since this is for an edit data view I need the user to see what the selected item is.

Please let me know if this is not clear.

Thanks!

#2
[eluser]Karman de Lange[/eluser]
this normally a browser issue, try ctrl-f5, if that fixes is, then you might have to set headers not to cache the page....

#3
[eluser]CodeIgniteMe[/eluser]
set no-cache to headers


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.