Reputation: 393
How can I make sure that, that second form elements go to the database cause when I check there the is no data but its been inputted by the user, if both forms are called from one controller
$form = new Form_Form1();
$this->view->form = $form;
$form2 = new Form_Form2();
$this->view->form2 = $form2;
if ($this->getRequest()->isPost()) {
$formData = $this->getRequest()->getPost();
if ($form->isValid($formData)) {
Upvotes: 1
Views: 92
Reputation: 5772
Try this:
if ($form->isValid($formData) && $form2->isValid($formData)) {...
Upvotes: 1