Validation form - 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: Validation form (/showthread.php?tid=66666) |
Validation form - superior - 11-19-2016 Hello, When trying to validate my form I think there is going something wrong, required fields shows messages on the first run. But when entering the Firstname and Passwords the Lastname doesn't validate anymore. The code below is inside: application/Config/Validation.php PHP Code: public $manager = [ Is there something wrong, or is this a name conflict with the validation? RE: Validation form - ridho - 11-19-2016 there is no "trim" validation rule in ci4 RE: Validation form - superior - 11-19-2016 Looked at the Rules file and you are correct, this has been set on the required already. However the problem still occur when removing the trim| from the check. RE: Validation form - ridho - 11-19-2016 Please put Your controller code here, and what error that showing on the first run? RE: Validation form - superior - 11-19-2016 (11-19-2016, 02:20 PM)ridho Wrote: there is no "trim" validation rule in ci4 (11-19-2016, 02:36 PM)ridho Wrote: Please put Your controller code here, and what error that showing on the first run? There is no error shown, the check is skipped when Password has a value. PHP Code: $this->validation->run([ RE: Validation form - ridho - 11-19-2016 I tested with no problem. The code PHP Code: if($validation->run([ Result PHP Code: Array RE: Validation form - superior - 11-19-2016 (11-19-2016, 02:20 PM)ridho Wrote: there is no "trim" validation rule in ci4 (11-19-2016, 05:05 PM)ridho Wrote: I tested with no problem. It happens when setting the following order: Firstname Username Password Passconfirm Then the lastname is skipped from the check, I did not put any value in Lastname that should result in error "The lastname field cannot be empty" but it somehow skipped the check. RE: Validation form - ridho - 11-19-2016 (11-19-2016, 05:49 PM)superior Wrote: It happens when setting the following order: I think the problem is your code, you should check again your code, check your form view. It's working with empty Lastname value. PHP Code: Array RE: Validation form - superior - 11-20-2016 I've found the problem in my code, must have been a hard saturdaynight because it's right there. Even in this topic you can see what's wrong with it. In my #5 reply, take a close look at what i'm posting on Lastname... Feeling stupid right now for not seeing this before, i'm sorry and thank you for the feedback! |