Welcome Guest, Not a member yet? Register   Sign In
Form Validation Error
#13

[eluser]CroNiX[/eluser]
Well, things like this are completely unnecessary and slows your app down, albeit by a very small amount. But still, pretty wasteful.

Code:
private function get_post( $post_var )
{
  return $this->input->post( $post_var );
}
Just using $this->input->post($post_var); directly would be much better and faster.


Line 122:
Code:
$user_data =
I'm sure that's causing an error...are you displaying errors?

As far as not showing the form/validation errors, it's because you aren't telling it too. You only tell it to show 'The form was not validated!' no matter what the errors are
Line 163:
Code:
$output_array = array(
  'error' => TRUE,
  'message' => validation_errors()//'The form was not validated!'
);

In your callbacks, when setting the error messages, the error message name must match the callback function name exactly or it won't be able to match the error name to your rule.
example:
Code:
public function email_address_exists($str)
{
   if ($this->users_model->is_email_address_available($this->input->post('email_address')))
   {
     //function name is 'email_address_exists', so that's what 'email_address' needs to be
     //in set_message()
     $this->form_validation->set_message('email_address', 'Testing2');
     return FALSE;
   }
   else
   {
     return TRUE;
   }
}
If you've added the prefixes, they need to be included in the set_message() also. The error name must match the function name.

There might be more...


Messages In This Thread
Form Validation Error - by El Forum - 07-31-2012, 10:46 AM
Form Validation Error - by El Forum - 07-31-2012, 10:59 AM
Form Validation Error - by El Forum - 07-31-2012, 11:01 AM
Form Validation Error - by El Forum - 07-31-2012, 11:17 AM
Form Validation Error - by El Forum - 07-31-2012, 11:20 AM
Form Validation Error - by El Forum - 07-31-2012, 11:32 AM
Form Validation Error - by El Forum - 07-31-2012, 11:37 AM
Form Validation Error - by El Forum - 07-31-2012, 11:44 AM
Form Validation Error - by El Forum - 07-31-2012, 11:50 AM
Form Validation Error - by El Forum - 07-31-2012, 11:53 AM
Form Validation Error - by El Forum - 07-31-2012, 11:56 AM
Form Validation Error - by El Forum - 07-31-2012, 11:59 AM
Form Validation Error - by El Forum - 07-31-2012, 12:10 PM
Form Validation Error - by El Forum - 07-31-2012, 12:22 PM
Form Validation Error - by El Forum - 07-31-2012, 12:30 PM
Form Validation Error - by El Forum - 07-31-2012, 12:38 PM
Form Validation Error - by El Forum - 07-31-2012, 12:39 PM
Form Validation Error - by El Forum - 07-31-2012, 12:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB