[eluser]TheFuzzy0ne[/eluser]
Because the post array exists still, and the form will be repopulated with the values again.
Three more ways to do it:
Maybe have another view which doesn't use set_value(), for each of your edit and save pages, and you can load that, although I think that's just a waste of disk space.
The second method may be to set the variables in your controller, use set_value() if the validation hasn't passed, and just set the variable to '', if it did:
Code:
$validation_passed = FALSE;
if ($this->form_validation->run())
{
$validation_passed = TRUE;
# Add the data to the database.
}
$data['event_name'] = ($validation_passed) ? '' : set_value('event_name');
$data['event_description'] = ($validation_passed) ? '' : set_value('event_description');
But this would require you to change the structure of your of your code... You'd probably have to set a config item to say that the validation has passed, so your edit and save methods know what to do.
Finally, you could just unset the post array, although that doesn't feel right to me. It may cause some problems, but I doubt it will.