Welcome Guest, Not a member yet? Register   Sign In
how does form_dropdown() magically repopulate my dropdown ?
#1

[eluser]Unknown[/eluser]
hello

I am an almost complete CI newbie (but completely loves the framework anyway!)

I don't understand how my dropdown is (magically) repopulated on submit (by post value) as I don't provide any default value or set_value rule.

Here is my code :

view :
Code:
echo form_dropdown('marque', $options_marque, $options_marque_selected);

controller :
Code:
$data['options_marque'] = $this->load->model('global/marque_model')->get_options();
$data['options_marque_selected'] = array();

If I run form_validation on submit with an error, my dropdown is repopulated with the value I chose even if I don't provide any set_value or set_select instruction !

Where is the magic ?


Messages In This Thread
how does form_dropdown() magically repopulate my dropdown ? - by El Forum - 09-14-2011, 03:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB