as you can already guess that i am trying to hide the default error messages and override each of them with a custom string, is there any way to do it once? Like this:
01-07-2016, 05:33 AM (This post was last modified: 01-07-2016, 05:34 AM by Diederik.)
You could use the error_array() function for this purpose.
PHP Code:
$error_array = $this->form_validation->error_array(); if (is_array($error_array ) && !empty($error_array)) {
// Generate a single message for all fields combined: echo '<div class="error">Something is wrong with the form values.</div>';
// Or loop through the errors and output a message per fieldname foreach($error_array as $fieldname => $message) { // The $message variable contains the message you want to hide echo '<div class="error">There is a problem with the value for the ' . $fieldname . ' field.</div>'; }