I have this dropdown that fetches the options from the database. I would like to know how can I get the value of that selected option then after selecting, other datas from the database will be displayed in a table or form? It would look like this
Before selecting
Select from dropdown : option1
Name:
Age:
After Selecting
Select from dropdown : option2
Name: Michael
Age: 21
Controller
public function salesorders() { if ($this->session->userdata('logged_in')) { $this->header2(); $data['groups'] = $this->secretary_model->getAllGroups(); $this->load->view('secretary/transactions',$data); } else { redirect('secretary/sec_login_view'); } } Model
function getAllGroups() { $query = $this->db->query('SELECT firstname FROM tblcustomer'); return $query->result(); } View
<?php echo "Select Customer"; $options = array(); foreach($groups as $group) { $options[$group->firstname] = $group->firstname; } echo form_dropdown('dropdown', $options); ?> <br> <br> <br> <table id="myTable" class="table table-bordered" > <thead > <tr> <th>Order #</th> <th>Customer Name </th> <th>Items</th> <th>Note</th> <th>Qtt.</th> <th>Total Price</th> <th>Shipping Address</th> <th>Status</th> <th>Edit</th> </tr> </thead> <tbody>