![]() |
Multiple Custom validation callbacks only work if using "required" rule? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Multiple Custom validation callbacks only work if using "required" rule? (/showthread.php?tid=4541) |
Multiple Custom validation callbacks only work if using "required" rule? - El Forum - 12-01-2007 [eluser]lebe0024[/eluser] Has anybody experienced this before? For one field, I am using two custom validation callbacks. The trouble is that the second one listed never gets called. CI just assumes it passes. The problem does not occur if "required" precedes them both. Weird. Code: function _loadFormValidation() Multiple Custom validation callbacks only work if using "required" rule? - El Forum - 12-01-2007 [eluser]tonanbarbarian[/eluser] this seems to be intensional (although I cannot see why but the logic of it may escape me at the moment) from Validation class line 278: Code: // If the field isn't required and we just processed a callback we'll move on... so if the field is not required and a callback didnt return false it will stop processing rules might want some of the developers to explain the logic behind this I guess Multiple Custom validation callbacks only work if using "required" rule? - El Forum - 12-01-2007 [eluser]Derek Allard[/eluser] I confess that I haven't looked through your code, but this sounds familiar to a change we made with coolfactor's input. Try checking the validation library out of the svn, and let me know if you still experience this. Multiple Custom validation callbacks only work if using "required" rule? - El Forum - 12-07-2007 [eluser]yongkhun[/eluser] Derek, I have checked out the validation library from the SVN but the problem still remain. The 2nd custom validation will not trigger if the rule does not contain "required". Please help. |