Question

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)) {     
Était-ce utile?

La solution

Try this:

if ($form->isValid($formData) && $form2->isValid($formData)) {...
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top