title: change event in form_dropdown codeigniter
body: <p>I developed 2 drop downs using <code>form_dropdown</code> I want to change 2nd dropdown to the change event in 1st one. can i do it using js ?</p>
  
  <pre><code>public function get_employee_to_division($seleted_val = '') {
          $this-&gt;db-&gt;select(array('emp_profile.emp_id', 'emp_profile.emp_no', 'emp_profile.name_short'));
          $this-&gt;db-&gt;from('emp_in_division');
          $this-&gt;db-&gt;join('`emp_profile`', '`emp_in_division`.`emp_id` = `emp_profile`.`emp_id`', 'INNER');
          $this-&gt;db-&gt;where('emp_in_division.division_id' . '=' . '1');
          $this-&gt;db-&gt;order_by("emp_profile.emp_no", "asc");
          $d = $this-&gt;db-&gt;get();
  
          if ($d) {
              $data = array();
              $data[] = "Select Employee";
              foreach ($d-&gt;result() as $row) {
  
  // Add array keys to the array while looping...
                  $data[$row-&gt;emp_id] = $row-&gt;emp_no . '-' . $row-&gt;name_short;
              }
  
              $emp_dropdown = form_dropdown('employer_id" id="employer_id" class="form-control text-left"', $data, $seleted_val);
              return $emp_dropdown;
          } else {
              return FALSE;
          }
      }
  </code></pre>
  
  <p>here is my drop downs
  <a href="https://i.stack.imgur.com/wwle6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wwle6.png" alt="dropdowns"></a></p>