[eluser]ericrjones1[/eluser]
Peter,
I am pretty sure that my proposal works.
[quote author="Peter Lachky" date="1261542309"]
Code:
<?php echo form_dropdown('kategoria', $kategorie, set_value('kategoria', $kategoria)) ?>
[/quote]
Your proposed solution for resetting the form...
[quote author="Peter Lachky" date="1261542309"]
Code:
<?php echo form_dropdown('kategoria', $kategorie, $this->input->post('kategoria') ? $this->input->post('kategoria') : $kategoria) ?>
[/quote]
...is similar to what the set_value function is doing (check it out in the CI_Form_Validation Class).
Code:
function set_value($field = '', $default = '')
{
if ( ! isset($this->_field_data[$field]))
{
return $default;
}
return $this->_field_data[$field]['postdata'];
}
I would check for the following items:
1. $kategoria is a key in the array $kategorie
2. $kategoria is of the expected type and value
3. check the return value of set_value() and how that is different from the $this->input->post() value