I have a controller which loads the view like this:
class A extends Controller{
public function simpleForm(){
//this generates the form
}
public function simpleFormSubmitted(){
// Simple form is submitted here. Here I perform validation and if
// validation fails I want to display simpleform again with all the values
// inputted by the user as it is and if validation succeeds I want to
// redirect to some other page. I am using simple HTML to generate the
// form and not the formhelper of CodeIgniter because I am more comfortable
// with HTML rather than remembering the syntax of CodeIgniter.
}
}
Here is how to preserve the form fields when dealing with errors…
This is how to re-populate the HTML form…
For more information look over here – Form Validation in Codeigniter
Look for the heading
Re-populating the form