form validation callback problem |
[eluser]flaky[/eluser]
Hi I'm having kind of an issue here, the callback function for email validation is never called, I have no clue why it isn't being called, I even removed all the validation (required, valid_email) and left only the callback function, but it won't work, here is the complete code. help!! Some info, if it helps in any way OS: Windows 7 Web Server: IIS 7 PHP: v5.3 MySQL: v5.1.37 Code: <?php if(!defined('BASEPATH')) exit('No direct script access allowed');
[eluser]Flemming[/eluser]
I'm guessing that your callback needs to return FALSE if it has failed. You can return the $user_email inside the set_message rather than at the end of the function ... Code: $this->form_validation->set_message('user_email_check', 'The email' . $user_email . ' already exists'); ?
[eluser]flaky[/eluser]
Code: return $this->user_model->exists($user_email); even if I change it to Code: public function user_email_check($user_email){
[eluser]Flemming[/eluser]
hmmmm... are you using HMVC (modules) by any chance?
[eluser]Flemming[/eluser]
Ah! Then you need to do this: Code: if ($this->form_validation->run($this) == TRUE){ notice '$this' inside the run() I can't remember why ... I just remember that I ran into exactly the same issue a while back and that was the solution!
[eluser]Flemming[/eluser]
which version of HMVC are you using? can anyone else suggest a solution to Flaky's problem?
[eluser]flaky[/eluser]
found the solution http://www.mahbubblog.com/php/form-valid...deigniter/ thanks for your help
[eluser]Flemming[/eluser]
really sorry about that - I remember now that yes, I had to do exactly that in order to get it to work! apologies for only giving you a part of the solution! Glad you got to the bottom of it in the end :-) |
Welcome Guest, Not a member yet? Register Sign In |