Answer by Mitchell McKenna for Make form remember earlier submitted values with CodeIgniter

October 26 2010, 12:08am

If you are submitting to the same controller, you can get the previously submitted variables through $_POST (or $_GET depending on which form method you chose).

//use $_POST('name') if set, else use 'Name*' <?=form_input('name', (!empty($_POST('name')) ? $_GET('name) : 'Name*');?>