Welcome Guest, Not a member yet? Register   Sign In
Dropdown from DB Alphabetized
#9

[eluser]Michael Wales[/eluser]
Ah - I think what you are wanting is it to load, by default - "Select Client" then people click that to select whatever client they want? That's easy.

Code:
$data['Names']['default'] = '--Select Client--';
$this->db->query('SELECT last FROM Names ORDER BY last ASC');
$query = $this->db->get('Names');
foreach ($query->result() as $row){
     $data['Names'] [$row->last] = $row->last;
}

//LOAD  VIEW AND DATA FOOL
$this->load->view('index_view', $data);

Code:
$formAtt = array('id'=>'selClient');
echo form_open('selectClient', $formAtt);
$js = 'onChange = alert(document.selClient.clients.options[document.selClient.clients.selectedIndex].value)';
echo form_dropdown('clients', $Names, 'default', $js);
echo form_close();


Messages In This Thread
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 10:46 AM
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 12:35 PM
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 01:16 PM
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 01:23 PM
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 01:45 PM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 11:41 AM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 11:50 AM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 12:05 PM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 12:21 PM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 12:27 PM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 12:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB