Welcome Guest, Not a member yet? Register   Sign In
Custom callback function in form validation not working
#3

[eluser]LuckyFella73[/eluser]
Hi alucard,

the Userguide says:
Quote:To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

It seems that part is missing where you set the rule.

Code:
// should look like:
$this->my_form->form_validation->set_rules('description', $this->field_labels['description'], "trim|callback_check_against_plan_type|xss_clean");

It may be a good idea to make the callback function private!

Code:
function _check_against_plan_type { ... }

// then set the rule like this:
$this->my_form->form_validation->set_rules('description', $this->field_labels['description'], "trim|callback__check_against_plan_type|xss_clean");

Hope that helps


Messages In This Thread
Custom callback function in form validation not working - by El Forum - 05-13-2011, 02:21 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 02:30 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 02:31 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 02:59 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 03:09 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 03:15 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 03:31 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 03:48 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 03:49 AM
Custom callback function in form validation not working - by El Forum - 05-13-2011, 04:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB