![]() |
Need help
After Update 4.2.12 to 4.3.1 Validation error not working, is there code need to change? Because error validation not show Please Controler BaseController.php PHP Code: <?php Controller Login.php PHP Code: class Login extends BaseController PHP Code: public function ceklogin() My View login_view.php PHP Code: <div class="mb-3">
Yes, you need to change the code.
See https://codeigniter4.github.io/CodeIgnit...ion-errors (01-15-2023, 05:27 PM)kenjis Wrote: Yes, you need to change the code. Thank You it works but value="<?= old('field_name')?>" not return the old value after error message how to resolve this Sir?
old() did not change. It should work as before.
How do you use it? Sample code? (01-16-2023, 08:02 PM)kenjis Wrote: old() did not change. It should work as before.My Controller Login.php PHP Code: public function ceklogin() This is my View Page Login.php PHP Code: <?php $validation = \Config\Services::validation(); ?> When Validation is-invalid old input value not show
old() needs redirect()->withInput() in the previous page(request).
See https://codeigniter.com/user_guide/gener...s.html#old I think your code does not work in v4.2. You need to use Form helper set_value(). See https://github.com/kenjis/ci4-validation-tutorial (01-18-2023, 06:10 PM)kenjis Wrote: old() needs redirect()->withInput() in the previous page(request). Thanks you Sir, its Works
|
Welcome Guest, Not a member yet? Register Sign In |