title: How to mark the current select option to be selected
body: <p>I have a select list on my view. After click on one of the options，the controller will refresh the page based on the selected option. However, the problem is after refreshing the page, the selected option isn't marked as selected. Also I want to sent the default <code>ALL</code> option to the controller when load the page, but I don't know how to do it.</p>
  
  <p>Here is the View:</p>
  
  <pre><code> &lt;form method="post" accept-charset="utf-8" action="&lt;?php echo base_url("account/myaccount_ticketmanagement"); ?&gt;"&gt; 
   &lt;select name="change_event" onchange="this.form.submit()" type="text" class="form-control" style="margin-top:-3px; width:60%; float: right; background-color: #414042; border:none; box-shadow: none; color: white;"&gt;
   &lt;option value="ALL" selected="selected"&gt;ALL&lt;/option&gt;
   &lt;?php
         foreach ($e_names as $e_name){
         echo '&lt;option value="'.$e_name[0]['e_name'].'"&gt;'.$e_name[0['e_name'].'&lt;/option&gt;';     
                                          }
   ?&gt;
   &lt;/select&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>This is the code in the controller:</p>
  
  <pre><code> $current_E = $this-&gt;input-&gt;post('change_event');
   if(isset($current_E)&amp;&amp;!empty($current_E)){
     $data['record'] = $this-&gt;db-&gt;select('ticket_id, Qty, fullname,purchase_time, ticket_type, ticket_price, delivery')
                      -&gt;where('user_id',$user_id)-&gt;get('Guest', $config['per_page'], $this-&gt;uri-&gt;segment(3));
  
   }
   else{
     if($current_E == 'ALL'){
       $data['record'] = $this-&gt;db-&gt;select('ticket_id, Qty, fullname, purchase_time, ticket_type, ticket_price, delivery')-&gt;where('user_id',$user_id)-&gt;get('Guest', $config['per_page'], $this-&gt;uri-&gt;segment(3));
  
     }
     else{
       $id = $this-&gt;db-&gt;select('event_id')-&gt;where('e_name',$current_E)-&gt;get('events')-&gt;result_array();
       $data['record'] = $this-&gt;db-&gt;select('ticket_id, Qty, fullname,purchase_time, ticket_type, ticket_price, delivery')-&gt;where('user_id',$user_id)-&gt;where('event_id',$id[0]['event_id'])-&gt;get('Guest', $config['per_page'], $this-&gt;uri-&gt;segment(3));
     }         
  }
  </code></pre>