Welcome Guest, Not a member yet? Register   Sign In
CI drop_down() and static options
#1

[eluser]Asinox[/eluser]
Hi, how's going on?

can somebody say me how ill add static option's to the drop_down() form?

i pass the data from database, but i want to add static option too....

how ill do that?

Thanks u.
#2

[eluser]TheFuzzy0ne[/eluser]
Static options? Undecided

Please show an example of your code, and what you are trying to do.
#3

[eluser]Asinox[/eluser]
i fill the dropdown with result from data base
Code:
echo form_dropdown('negocio',$negocios);

but now i know how put static option in the select and option from database together, in my Model

Code:
function listarTiposNegociosCombox(){ //COMBOX
        
        $query = $this->db->get('tipos_de_negocios');
        if($query->num_rows()>0){
            foreach($query->result_array() as $row){
                $data[$row['id']] = $row['tipo'];
                //return $row;
            }
            return $data;
        }else{
            return FALSE;
        }
        $query->free_result();
    }


this function make a select very fine, but ... now im asking, how ill put an extra <option value="">Select One</option> in the select when the select is filled from the database.


mmmm

Thanks
#4

[eluser]TheFuzzy0ne[/eluser]
Code:
$result = $this->db->get('tipos_de_negocios')->result_array();

$result[] = array('id' => 16, 'tipo' => 'Hair Dresser');
$result[] = array('id' => 17, 'tipo' => 'Painter');




Theme © iAndrew 2016 - Forum software by © MyBB