Form Error : Remove 'The' Word from Error |
[eluser]npCoda[/eluser]
Hello! I am beginner to Code Igniter. Recently I am working in form validation. I am using form validation error to check the error. Code: $this->load->library('form_validation'); My requirement : When error is displayed,it shows: The Name field is required. The Email field is required. How can I remove 'The' from the error. Just I want to display as 'Name is required' I tried to search the text in system/libraries/Form_validation.php file and remove 'The' word but could not get. Can someone suggest me? Thank you for you time.
[eluser]Aken[/eluser]
Check the set_message() method in the Form Validation library documentation.
[eluser]weboap[/eluser]
check http://ellislab.com/codeigniter/user-gui...tingerrors section Setting Error Messages
[eluser]npCoda[/eluser]
I went to Form Library to see set_message() but I could not find the text where these error are assigned.
[eluser]Sanjay Sarvaiya[/eluser]
You can do with this. Code: $this->load->library('form_validation');
[eluser]Ayeyermaw[/eluser]
Create a language folder in your application directory and create the following file: application/language/english/form_validation_lang.php then place the following in that file: Code: <?php EDIT: For you reference this is an override of the same language file in ./system/language/english/form_validation_lang.php The manual does suggest you can change this file directly but if you do so and update your codeigniter core files in the future you could overwrite your changes. It's good practice to never amend files in your codeigniter system directory. Codeigniter will always look for your language file in the application directory before it uses its own. Just be aware that if a new rule appears in future codeigniter versions you'll need to add that to your override file. Hope that helps
|
Welcome Guest, Not a member yet? Register Sign In |