[eluser]reneschaub[/eluser]
Hmmm it looks well but i don`t understand where i must insert the code?
I think this comes in system\helpers\form_helper.php
--------------------------------------------------------------------------------------
function Custom_dropdown_city( $name, $country_code, $selected_id = '', $reload = FALSE )
{
$this->load->database('c88v2');
$this->db->select('id, name, name_local');
$this->db->from('c88v2_city');
$this->db->where('country_code', $country_code );
$this->db->order_by('display_order', 'desc');
$this->db->order_by('name', 'asc');
$query = $this->db->get();
$num_rows = $query->num_rows();
$result_array = array();
if ( $num_rows <= 0)
{
//$result_array['-1'] = '-';
$result_array['0'] = ' - IF EMPTY, SELECT THIS - ';
}
else
{
$result_array['-1'] = ' - Select - ';
foreach ($query->result_array() as $row)
{
$result_array[ $row['id'] ] = $row['name'];
}
}
--------------------------------------------------------------------------------------
And i think this in application\views\form_view.php
$javascript = $reload == TRUE ? 'onchange="this.form.submit();"' : '';
$this->load->helper('form');
return form_dropdown( $name, $result_array, $selected_id, $javascript );
}
--------------------------------------------------------------------------------------
Right?