CodeIgniter Forums

Full Version: Unable to repopulate select box after form submit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]term25[/eluser]
I have this in my view:

Code:
$options = array(
  'first'  => 'First option',
  'second'    => 'Second option',
  'third'   => 'Third option',
);

echo form_dropdown('what', $options, 'third');

And now always the third option is shown when the fields are repopulating after submit validation error.

I can repopulate input fileds but I am unable to repopulate select dropdown boxes.

How to repopulate them after submit?

I do not want that user get back when he had make a mistake and everything he chose in dropdown selectboxes is missing and he has to set it again.

Thanks in advance for any help.