validation Custom MSG - 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 Custom MSG (/showthread.php?tid=1896) |
validation Custom MSG - El Forum - 07-03-2007 [eluser]MMCCQQ[/eluser] hi! i got some doubts. about validation Library. this is my login function Code: function Login() i wanna send a Custom Msg when Username and Password dont match. how can i do this? i added this Code: $this->validation->set_message('macth', 'Username and password don macth'); but dont work! how? validation Custom MSG - El Forum - 07-03-2007 [eluser]kgill[/eluser] The validation class can't be used to spit out messages in the way you're trying. It will return the error message if one of the rules fails - right now, the only check you are putting on a username is that it must be filled in. If you want to include checking that it is also correct you need to use a callback function. See the section in the user guide for the validation class for examples on how to do it. - K |