Welcome Guest, Not a member yet? Register   Sign In
Callback function being called twice if use more than one callbacks
#1

[eluser]coldfire82[/eluser]
Hi,

My CI Version is: 2.0.3

My form validation rule looks like this,

Code:
$this->form_validation->set_rules('email', 'Email', 'trim|required|max_length[45]|valid_email|callback_check_email|callback_check_expiry_date');

In check_email callback i am adding a record in my table. Afterwards, when I appended a new callback in the same rule i.e. "callback_check_expiry_date", I found out that the earlier callback_check_email is executing twice as I checked my db table and there were two records instead of just one. And when I removed the second callback, it was executing correctly and added one record.

Why is it so ?

Although I have now removed my second callback and doing the work in just one callback but still curious, why ?





Theme © iAndrew 2016 - Forum software by © MyBB