Possible Duplicate:
Codeigniter 2 forms on one page, validation_errors problem
I have 2 forms in my page. I need to validate them 1 at a time but I think there is a conflict. Here take a look:
when I submit either of the form, both of them show the same error message
I use validation_errors()
to display the messages. How can I validate the form 1 at a time?
Here is the code
public function update_user_info(){
$this->form_validation->set_rules("firstname","First Name","required");
$this->form_validation->set_rules("lastname","Last Name","required");
$this->form_validation->set_rules("middlename","Middle Name","required");
if($this->form_validation->run()===false){
//wrong
}
else { //correct }
}