I want to re-populate (i.e refill) values posted from a select form field after validation. I know codeigniter user guide proposed using set_select() function but their example from the guide assume you've hard-coded (in HTML) the array of values for the 'select' form element. In my case I used the Form Helper and my select field values are pulled from an array() like so:
$allstates = array('blah','blah2','blah3','blah4','blah5');
echo form_label('Select State Affiliate', 'state');
echo form_dropdown('state', $allstates);
Needless to say, $allstates array is dynamic and changes over time. So how do I code such that my select field can be re-populated with the value the user selected?