Welcome Guest, Not a member yet? Register   Sign In
Validation matches doesn't seem to work
#1

[eluser]johnwbaxter[/eluser]
i have got this:

$rules['password'] = "trim|required|min_length[4]|max_length[32]";
$rules['passwordagain'] = "trim|matches[password]";

Where i want passwordagain to match password or fail.

But it doesn't seem to work, i can put two different words in them and it doesn't error.

Anyone know why that might be?
#2

[eluser]xwero[/eluser]
what do you get when you do
Code:
$rules[’password’] = “required|min_length[4]|max_length[32]|matches[passwordagain]”;
Then of course you can't use the trim function.
#3

[eluser]johnwbaxter[/eluser]
You are the man xwero. Worked a treat.

Slightly off topic but errr do you know how to re-populate "select" form elements using the CI validation?

Cheers!
#4

[eluser]johnwbaxter[/eluser]
No wait, ignore me, i do know how to do the select thingy. Sorry!
#5

[eluser]xwero[/eluser]
you can use the set_select method, read the userguide for the usage.
no problem Smile




Theme © iAndrew 2016 - Forum software by © MyBB