This code is taken from CI user guide :
$options = array( 'small' => 'Small Shirt', 'med' => 'Medium Shirt', 'large' => 'Large Shirt', 'xlarge' => 'Extra Large Shirt', ); echo form_dropdown('shirts', $options, 'large'); // Would produce: <select name="shirts"> <option value="small">Small Shirt</option> <option value="med">Medium Shirt</option> <option value="large" selected="selected">Large Shirt</option> <option value="xlarge">Extra Large Shirt</option> </select> Looking from the code above, this code should be fine (taken from controller):
$data_search = array('kelas' => 'Kelas', 'nama' => 'Nama', 'alamat' => 'Alamat', 'bulan' => 'Bulan Lahir'); In my html(view) :
<?php echo form_dropdown('ddl_search', $data_search, 'id="ddl_search"');?> But the fact is its give me the undifined variable:data_search error, could you explain whats going on here? Thanks for your time :D