Welcome Guest, Not a member yet? Register   Sign In
Validation form
#7

(This post was last modified: 11-19-2016, 05:50 PM by superior.)

(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.

The code
PHP Code:
if($validation->run([
 
'Firstname'     => 'John',
 
'Lastname'      => 'Smith',
 
'Username'      => 'john',
 
'Password'      => 'pass',
 
'Passconfirm'   => 'passw'
 
], 'manager'))
 {
 echo 
'Ok';
 }else{ 
 
print_r($validation->getErrors());
 } 

Result
PHP Code:
Array
(
 
   [Username] => The Username field must contain a valid email address.
 
   [Password] => The Password field must be at least  characters in length.
 
   [Passconfirm] => The Passconfirm field does not match the  field.


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.
Reply


Messages In This Thread
Validation form - by superior - 11-19-2016, 08:44 AM
RE: Validation form - by ridho - 11-19-2016, 02:20 PM
RE: Validation form - by superior - 11-19-2016, 02:25 PM
RE: Validation form - by ridho - 11-19-2016, 02:36 PM
RE: Validation form - by superior - 11-19-2016, 02:51 PM
RE: Validation form - by ridho - 11-19-2016, 05:05 PM
RE: Validation form - by superior - 11-19-2016, 05:49 PM
RE: Validation form - by ridho - 11-19-2016, 07:33 PM
RE: Validation form - by superior - 11-20-2016, 06:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB