Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] HMVC and Form_Validation: Can't use my callback_ functions?
#1

[eluser]datdesignguy[/eluser]
Hi all,

I'm running a simple form_validation in an account controller. I'm running CI 1.7.1 + HMVC (modular extensions).

In my account/signup module, I need to do some pretty standard fair. I need to verify that a user has not already created an account with their email address. So I added to the email rule "callback_checkexists":

Code:
$this->form_validation->set_rules('email',E-Mail Address','required|valid_email|callback_checkexists');

and my function is:

Code:
private function checkexists($email) {
    $this->form_validation->set_message('checkexists','An account already exists for %s.');
    return false;
}

Obviously, that code should trigger the error every single time, as it always returns false. Yet, it NEVER gets called.

The two posts below make me think that HMVC might be causing the problem, but I'm not quite sure where to hack about to fix it?

* http://ellislab.com/forums/viewthread/123780/
* http://ellislab.com/forums/viewthread/125780/

<b>UPDATE: Found the solution here:</b>
<a href="http://ellislab.com/forums/viewthread/92212/P90/#578755">HMVC Form_Validation Callbacks</a>

Thanks!

Greg J




Theme © iAndrew 2016 - Forum software by © MyBB