Welcome Guest, Not a member yet? Register   Sign In
[1.7.2] form_validation matches[] multidimensional array
#1

[eluser]Unknown[/eluser]
This is the return from the $this->CI->form_validation->_config_rules var. The issue is here... matches[user_change_password[password]]

Code:
Array
(
    [user_change_password] => Array
        (
            [0] => Array
                (
                    [field] => user_change_password[old_password]
                    [label] => Old Password
                    [rules] => required|callback__password_match
                )

            [1] => Array
                (
                    [field] => user_change_password[password]
                    [label] => New Password
                    [rules] => required
                )

            [2] => Array
                (
                    [field] => user_change_password[password_confirm]
                    [label] => Confirm New Password
                    [rules] => required|matches[user_change_password[password]]
                )

            [3] => Array
                (
                    [field] => user_change_password[submit]
                    [label] =>
                    [rules] =>
                )

        )

)

I have been using the matches validation for a while, however this is the first instance I use a multidem array.

I get the following UI error...

Quote:The Confirm New Password field does not match the user_change_password[password field.

Looks like it cuts the multidem bracket (missing "]") to gather the field name in the "matches[]" validation.

I suspect this is a bug since multidem array names work with everything else in the form_validation class.

I expect the validation class to return user_change_password[password] and NOT user_change_password[password from matches[user_change_password[password]]


Messages In This Thread
[1.7.2] form_validation matches[] multidimensional array - by El Forum - 02-19-2010, 09:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB