Sticky form elements in CodeIgniter
It is good for user experience to offer feedback; we do this in the preceding sections with
validation_errors(), but it is also useful to keep user data in form elements to save them having to re-type everything, should there be an error. To do this, we need to use CodeIgniter's
Make sure that you load
$this->load->helper('form'); from within the
__constructor() of the controller; however, you can always autoload the helper from
How to do it...
We're going to edit the
- Amend the file to show the following (changes in bold):
<?php echo form_open('form/submit_form') ; ?> ...