Welcome Guest, Not a member yet? Register   Sign In
a custom callback to check if the value is empty
#6

[eluser]xwero[/eluser]
A hackish solution would be to change the error message for the error array
Code:
if(!this->validation->run())
{
   $this->validation->error_string = '';
   foreach($this->validation->_error_array as $key => $error)
   {
       $default_error = sprintf($this->lang->line('required'),'fieldname'); // or the friendly name
       if($default_error == $error)
       {
           $error = sprintf($this->lang->line('custom_required'),'fieldname');
           $this->validation->error_string .= $this->validation->_error_prefix.$error.$this->validation->_error_suffix;
       }
       else
       {
           $this->validation->error_string .= $this->validation->_error_prefix.$error.$this->validation->_error_suffix;
       }
   }
}


Messages In This Thread
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 02:41 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 03:12 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 03:23 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 03:58 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 04:11 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 04:15 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 04:59 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 11:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB