Jump to content

Multiple Form in one page and use for same action-Zend Framework


mrakodol

Recommended Posts

Hi all,

How to make that show to user one form, and when he type valid value refer to other form, and when user type valid value save that values to database?

For ex., I try that code, but it code didn't do nothing. Without other form he wok properly, but if I give here a other form, nothing is going to work.

$form1 = new Form_FirstForm();
$this->view->form=$form1;
    if($this->getRequest()->isPost()){
          if($form1->isValid($_POST)){
            	$data1 = $form1->getValues();
            	$this->view->form=$form2;
            	if($this->getRequest()->isPost()){
            		if($form2->isValid($_POST)){
            		$data2 = $form2->getValues();
}}}}

 

I use that for making pool module. In first form I enter a question and number of answers and in other form i need to enter the number of which depends on the answers of either entering the number on the previous form.

For example: I enter 5 in first form and I must enter 5 answers in other form...

This can be resolved by using a jQuery. Can somebody give me a example a code.Please.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.