I have a dropdown menu on my view that lets me select different items from the table. But, since by default there is one possible option at this instance, I want to set it instead of manually changing each one.
This is the code:
<td><?php
$tabindex = 1;
$extras = 'class = "smallInput" tabindex='.$tabindex;
$tracking_status_array = array ();
$tracking_status_array += array ('' => 'Select Status' );
foreach ( $tracking_status_list as $status ) {
$tracking_status_array += array (trim ( $status->tracking_status_id ) => trim ( $status->status_text ) );
}
echo form_dropdown ( 'tracking_status_id[]', $tracking_status_array, set_value ( 'tracking_status_id[]'), $extras);
?></td>