10-23-2009, 07:00 PM
[eluser]fireproofsocks[/eluser]
I moved my form validation rules to a config file as outlined here:
http://ellislab.com/codeigniter/user-gui...ation.html
But as soon as I did that, the form never validates and no errors are shown. The forms were working before.
Anybody got ideas of what I can check? I'm using my own custom validation rules in libraries/MY_Form_validation.php
My Controller:
My config file (config/form_validation.php):
I moved my form validation rules to a config file as outlined here:
http://ellislab.com/codeigniter/user-gui...ation.html
But as soon as I did that, the form never validates and no errors are shown. The forms were working before.
Anybody got ideas of what I can check? I'm using my own custom validation rules in libraries/MY_Form_validation.php
My Controller:
Code:
// Display the advanced search form
if ($this->form_validation->run('contact_form') == FALSE)
{
$this->parser->parse('includes/contacts');
}
// Display the thank you message, send email
else
{
$this->parser->parse('includes/thankyou');
}
My config file (config/form_validation.php):
Code:
$config = array(
'advanced_search' => array(
array(
'field' => 'title_name',
'label' => 'Title Name',
'rules' => 'alpha_dash|xss_clean'
),
array(
'field' => 'categories[]',
'label' => 'Title Categories',
'rules' => 'is_mastercode[categories]'
),
),
/*-----------------------------------------------------*/
'contact_form' => array(
array(
'field' => 'first_name',
'label' => 'First Name',
'rules' => 'trim|required|alpha|min_length[2]|xss_clean'
),
array(
'field' => 'last_name',
'label' => 'Last Name',
'rules' => 'trim|required|alpha|min_length[2]|xss_clean'
),
),
);