One question about the validation error message - 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: One question about the validation error message (/showthread.php?tid=23543) |
One question about the validation error message - El Forum - 10-14-2009 [eluser]luffy[/eluser] The code below: $this->form_validation->set_rules('username', 'username', 'required'); $this->form_validation->set_rules('content', 'content', 'required'); $this->form_validation->set_message('required', 'custom message'); For example: If I want to show the "username error" and "content error" How to use the set_message? Because their rule is the same. One question about the validation error message - El Forum - 10-14-2009 [eluser]Flemming[/eluser] This post might help you! ... http://ellislab.com/forums/viewthread/45589/ Edit: but rather than hack the validation library I would extend it with MY_Form_validation http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html - see the section on extending core libraries One question about the validation error message - El Forum - 10-14-2009 [eluser]imn.codeartist[/eluser] To do that you need to modify Form_validation class One question about the validation error message - El Forum - 10-15-2009 [eluser]luffy[/eluser] [quote author="flemming" date="1255537785"]This post might help you! ... http://ellislab.com/forums/viewthread/45589/ Edit: but rather than hack the validation library I would extend it with MY_Form_validation http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html - see the section on extending core libraries[/quote] Why doesn't the development team add the code into the validation library ? |