CodeIgniter Forums
Validation Callback Not Being Called - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Validation Callback Not Being Called (/showthread.php?tid=27307)



Validation Callback Not Being Called - El Forum - 02-06-2010

[eluser]Dirigible[/eluser]
Hi all,
My callback function from validation rules isn't being called
The other validation rules for that field ARE being called -- (required|max_length[12]|alpha_dash)
but not my callback __check_login_name

Full code: $rules['login_name'] = "required|max_length[12]|alpha_dash|callback__check_login_name";

Thanks!


Validation Callback Not Being Called - El Forum - 02-07-2010

[eluser]JoostV[/eluser]
There's two underscores in callback__check_login_name. Did you name your callback function _check_login_name?


Validation Callback Not Being Called - El Forum - 02-07-2010

[eluser]Dirigible[/eluser]
yes.


Validation Callback Not Being Called - El Forum - 02-07-2010

[eluser]JoostV[/eluser]
Strange. Have you tried renaming it to check_login_name and calling it via callback_check_login_name?

To check whether or not the callback was called you can log a debug message
Code:
log_message('debug', 'check_login_name was called')



Validation Callback Not Being Called - El Forum - 02-07-2010

[eluser]Dirigible[/eluser]
yep. tried that too =/. It looks very similar to the examples...


Validation Callback Not Being Called - El Forum - 02-07-2010

[eluser]JoostV[/eluser]
Can you post your code, please?


Validation Callback Not Being Called - El Forum - 02-08-2010

[eluser]flaky[/eluser]
are you using HMVC?