I realise this request goes against the example provided in the CI documentation (which advises a separate \'success\' page view), but I would like to reutilise a given form
I've found that where:
it isn't enough to clear only the validation-rules array, you need to clear the validation-error array too.
To this end, I've added a method to system/libraries/Form_Validation.php, as follows:
public function clear_rules()
{
$this->_error_array = array();
$this->_field_data = array();
return $this;
}
Returning $this is important if you want to chain your form-validation methods.
In newer version 3.X, to clear set_value , $_POST=array()
and $this->_field_data = array();
in MY_Form_validation.php
library. try
Clear form data after success codeigniter using php not jquery