[eluser]4ever[/eluser]
So this is my code how I use it.
Code:
$this->load->library("MY_form_validation"); // my library
// $this->load->library("MY_form_create"); // my create
$this->load->helper("MY_form"); // my helper
$conf = array ( array("name", "Name", "trim|required"),
array("surname", "SurName", "trim|required"),
array("email","Email address", "trim|required|valid_email"),
array("psw", "Password", "trim|required|min_length[4]|max_length[32]"),
array("psw2", "Password Confirmation", "trim|required|min_length[4]|max_length[32]|matches[psw]")
);
$this->my_form_validation->set_rules($conf);
$data['main_content_page'] = 'includes/forms/signup_form';
if ($this->my_form_validation->run() == false ) die(validation_errors('<p class="error">')."</p>");
I hope this is better way then this:
Code:
$config = array(
array(
'field' => 'username',
'label' => 'Username',
'rules' => 'required'
),
array(
'field' => 'password',
'label' => 'Password',
'rules' => 'required'
),
array(
'field' => 'passconf',
'label' => 'Password Confirmation',
'rules' => 'required'
),
array(
'field' => 'email',
'label' => 'Email',
'rules' => 'required'
)
);
And now I am going to do my own class for simple creating and validating forms.
If anybody would to found the problem of previous post of mine, please let me know. I still want to know where was/is problem.