![]() |
Custom error message for validation - 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: Custom error message for validation (/showthread.php?tid=8595) |
Custom error message for validation - El Forum - 05-23-2008 [eluser]modano[/eluser] Hi, Im working on a form where I utilize the validation class, now here is my problem: I have two textfields on the form and at least one of them is required (there are other form objects). I got the rule down and working fine, but im not struggling with the error message. I know I can change the message for 'required', but that would screw up the message for other fields. What I need is an error message unique to these fields... Im thinking using callback validation function.....but not sure how to solve it.... I want it to say for example "At least one of [field1] and [field2] is required" while still showing the usual message for 'required', "The [field] is required" Did that make sense? any solution....? |