![]() |
Not receiving any validation error on view page - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Not receiving any validation error on view page (/showthread.php?tid=87388) |
Not receiving any validation error on view page - SubrataJ - 04-14-2023 My application runs on the latest version of CI, but somehow I am not getting any validation error on my view page. view page code:- Code: <form method="POST" action="<?= site_url('service-providers'); ?>" accept-charset="UTF-8"> and this is the code of the controller PHP Code: public function attemptLogin() on the controller, I can print the error but on the view page, it is coming blank. RE: Not receiving any validation error on view page - kenjis - 04-14-2023 Read https://codeigniter4.github.io/CodeIgniter4/libraries/validation.html#redirect-and-validation-errors RE: Not receiving any validation error on view page - SubrataJ - 04-14-2023 (04-14-2023, 02:10 AM)kenjis Wrote: Read https://codeigniter4.github.io/CodeIgniter4/libraries/validation.html#redirect-and-validation-errors I tried, but I am not getting my old input value as well as any errors, although I am using return redirect()->back()->withInput(); fixed it, thanks for the resource. this was helpful https://github.com/kenjis/ci4-validation-tutorial/blob/main/app/Views/form2.php RE: Not receiving any validation error on view page - kenjis - 04-14-2023 What was the issue? RE: Not receiving any validation error on view page - SubrataJ - 04-14-2023 (04-14-2023, 11:22 PM)kenjis Wrote: What was the issue? Instead of using set_value() and show_validation_error(), I was using old() and $validation->getError(). It was foolish of me I did not read the documentation properly. validation_show_error |