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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.