Welcome Guest, Not a member yet? Register   Sign In
One question about the validation error message
#1

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

[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
#3

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

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




Theme © iAndrew 2016 - Forum software by © MyBB