That was a bug of the component being used.
I have to use multiple forms in a page.
My Problem: I can not stop the code check the unsubmitted form with the other ?automaticly?. *Errors are different. One’s error is not shown under other’s error list.
Here is my code to generate required forms using formgenlib under my controller. By the way, If I click on the first button, "//do the stuff..." doesn’t work. But errors are shown.
$this->load->library('form');
$login_form = new $this->form;
$login_form
->open()
->col(240, 'left', 'left')
->text()
->col(170, 'left', 'left')
->password()
->col(100, 'left', 'right')
->submit('', 'submit_login')
->col(0)
->validate();
$data['login_form'] = $login_form->get();
$this->load->view('overal_header', $data);
$login_form->clear();
$radio = array(
array('', ''),
array('', ''),
);
$register_form = new $this->form;
$register_form
->open()
->fieldset()
->text()
->text()
.
.
.
->submit('', 'submit_form');
if($this->input->post('submit_form'))
{
$register_form->validate();
if($register_form->valid)
{
//do the stuff here...
}
}
$data['form'] = $register_form->get();
$data['errors'] = $register_form->errors;
$register_form->clear();
$this->load->view('page_welcome', $data);
$this->load->view('overal_footer');