Setting Validation Error Messages - 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: Setting Validation Error Messages (/showthread.php?tid=13208) |
Setting Validation Error Messages - El Forum - 11-14-2008 [eluser]mradlmaier[/eluser] Hi, The User Guide states: Quote: Either I am missing something in the User Guide, but what is the name of a rule? The Guide also states: Quote: So, where is the name of this rule? I need to know this to set error messages for a each form field, like "The email is required." Thanks, Michael Setting Validation Error Messages - El Forum - 11-14-2008 [eluser]khuram[/eluser] Hi Mike I am a total nobody on CI. Can you please tell me something about my questions. Its here http://ellislab.com/forums/viewthread/96974/. I'll check the user guide for your problem in the meanwhile. Much thanks. I know its kind of queer but what the hell. i aint getting no where with ppl not replying me. Setting Validation Error Messages - El Forum - 11-14-2008 [eluser]eger[/eluser] The rule in the example is "required". So you would set Code: $this->form_validation->set_message('required', 'Umm... %s is required buddy.'); Setting Validation Error Messages - El Forum - 11-14-2008 [eluser]khuram[/eluser] Hey what about my problem please I know it sounds offensive but so does coming first time to a forum and not getting a reply for argument's sake, I have tried to search the topic before posting. once again, [a]http://ellislab.com/forums/viewthread/96974/[/a] Setting Validation Error Messages - El Forum - 11-14-2008 [eluser]mradlmaier[/eluser] Eger, So, that way I specify one error message for ALL 'required' rules, with substitued human field names, right? But I cannot specify an error message per rule AND per field, right? Michael Setting Validation Error Messages - El Forum - 11-14-2008 [eluser]eger[/eluser] [quote author="mradlmaier" date="1226712976"]Eger, So, that way I specify one error message for ALL 'required' rules, with substitued human field names, right? But I cannot specify an error message per rule AND per field, right? Michael[/quote] I don't see a way to do that according to the docs. Maybe someone else might have a clever way to do this... Setting Validation Error Messages - El Forum - 11-24-2008 [eluser]moodh[/eluser] form_error('fieldname'); also returns true or false, so a simple if works if you want to write your own messages per field instead of per rule: Code: if(form_error('fieldname')) { edit, sorry for the old topic bump, but he asked for more ways =) |