Welcome Guest, Not a member yet? Register   Sign In
Problems with Form validation
#1

[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:
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'
        ),

    ),
);


Messages In This Thread
Problems with Form validation - by El Forum - 10-23-2009, 07:00 PM
Problems with Form validation - by El Forum - 10-24-2009, 12:05 AM
Problems with Form validation - by El Forum - 10-26-2009, 02:35 AM
Problems with Form validation - by El Forum - 11-20-2009, 01:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB