![]() |
Unable to Access an Error Message Corresponding to Your Field Name - 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: Unable to Access an Error Message Corresponding to Your Field Name (/showthread.php?tid=29695) |
Unable to Access an Error Message Corresponding to Your Field Name - El Forum - 04-18-2010 [eluser]01010011[/eluser] Hi, I've created this registration form (see attached) that registers new users and checks whether their user name already exists in the database. The problem is, instead of displaying the error message I wrote, it displays this error message: Quote:Unable to access an error message corresponding to your field name How do I correct this? Any assistance will be appreciated. Thanks in advance. Unable to Access an Error Message Corresponding to Your Field Name - El Forum - 04-18-2010 [eluser]01010011[/eluser] Hi, I figured out what the problem was: my message key did not match my function name: http://ellislab.com/codeigniter/user-guide/libraries/validation.html Unable to Access an Error Message Corresponding to Your Field Name - El Forum - 04-19-2010 [eluser]$ilovephp[/eluser] This is your code: Code: function username_not_exists($username) try editing your above code with this below: Code: function username_not_exists($username) Notice the $this->form_validation->set_message(), instead of 'username', we change the first parameter with the 'username_not_exists' which is the name of your call back method. Unable to Access an Error Message Corresponding to Your Field Name - El Forum - 04-19-2010 [eluser]$ilovephp[/eluser] [quote author="01010011" date="1271644784"]Hi, I figured out what the problem was: my message key did not match my function name: http://ellislab.com/codeigniter/user-guide/libraries/validation.html[/quote] Oops.. i did not notice your reply.. Unable to Access an Error Message Corresponding to Your Field Name - El Forum - 05-24-2010 [eluser]marcoslavorato[/eluser] Really thanks $ilovephp, works fine. I was with the same problem. |