[eluser]greedyh4mster[/eluser]
Hiya!
I have several forms. I am using form_validation to store all my rules across all forms. However, I face a problem displaying all the validation errors.
This is what is inside form_validation
Code:
$config = array(
'login' => array(
array(
'field' => 'username',
'label' => 'lang:username',
'rules' => 'required|alpha_numeric|trim|xss_clean|callback_check_username'
),
array(
'field' => 'password',
'label' => 'lang:password',
'rules' => 'required|alpha_numeric|trim|xss_clean'
),
array(
'field' => 'password_conf',
'label' => 'lang:password_conf',
'rules' => 'required|alpha_numeric|matches[password]|trim|xss_clean'
)
),
'register' => array(
array(
'field' => 'email_address',
'label' => 'lang:email_address',
'rules' => 'required|valid_email|trim|xss_clean|callback_check_email'
),
array(
'field' => 'person_name',
'label' => 'lang:person_name',
'rules' => 'alpha_numeric|trim|xss_clean'
)
)
);
Here is my controller calling the form.
Code:
if($this->form_validation->run('login') && $this->form_validation->run('register')){
In my view for the registration form, I have:
Code:
echo validation_errors();
But it is only echoing out the errors for the rule set: 'auth', but not the errors for the rule set: 'register'.
Please assists.