CodeIgniter Forums

Full Version: One question about the validation error message
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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.

El Forum

[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-gui...aries.html - see the section on extending core libraries

El Forum

[eluser]imn.codeartist[/eluser]
To do that you need to modify Form_validation class

El Forum

[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-gui...aries.html - see the section on extending core libraries[/quote]


Why doesn't the development team add the code into the validation library ?