Welcome Guest, Not a member yet? Register   Sign In
Form validation callback return value
#6

[eluser]mr lister[/eluser]
I think you are misunderstanding the documentation.

In your callback function, carry out what ever conditional statements you need on the POSTed data, then return the boolean result as either TRUE/FALSE depending on the result.

I agree with adityamenon, the form validation / callback function will not change your POSTed form data, you are only validating the form data based on set criteria.

The example:
Code:
if ($str == 'test')
{
$this->form_validation->set_message('username_check', 'The %s field can not be the word "test"');
return FALSE;
}
else
{
return TRUE;
}
will return - set the message - text as part of your validation for the field that called the function.

The documentation gives the above example, as Eric pointed out with the user guide link.


Messages In This Thread
Form validation callback return value - by El Forum - 06-08-2011, 11:28 AM
Form validation callback return value - by El Forum - 06-08-2011, 11:52 AM
Form validation callback return value - by El Forum - 06-08-2011, 11:55 AM
Form validation callback return value - by El Forum - 06-08-2011, 12:08 PM
Form validation callback return value - by El Forum - 06-08-2011, 11:34 PM
Form validation callback return value - by El Forum - 06-09-2011, 01:33 AM
Form validation callback return value - by El Forum - 11-29-2012, 06:48 PM
Form validation callback return value - by El Forum - 11-29-2012, 06:52 PM
Form validation callback return value - by El Forum - 11-29-2012, 07:02 PM
Form validation callback return value - by El Forum - 11-29-2012, 10:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB