[eluser]drewbee[/eluser]
Hi All,
I have a form that has the option of 'preview' before actually posting.
It appears the form helper class doesn't honor submitted data unless an error actually occurs.
So how did I have to rig up a solution to get this working correctly, in a sense where the preview box will show up with the posted data, as well as original form with the data appearing again?
I had to set a random form error manually EX.
Code:
$this->form_validation->_error_array[] = 'asdfasdf';
causing run() to fail, re-displaying my form and populating it as needed.
Is their a better way to do this or is this quick little rig up option the only way? The original goal is to redisplay the form is run() fails OR the submit_preview is pushed.
Unfortunately, it is a no go if run() passes, and any other scenario is present because the data will not repopulate.
Looks like another function for the form_validation class
Code:
function force_form_repopulate()
{
$this->_error_array[] = '';
}
Has anyone else encountered this and what they did to work around this? One of the biggest problems that could potentially be a problem is the call to show_errors(); I show my errors individually; but in a call to show_errors() all will show up.