Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3721142
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:27:18+00:00 2026-05-19T05:27:18+00:00

I have a one page website that has two seperate forms that need to

  • 0

I have a one page website that has two seperate forms that need to be posted back to the same page, the problem being, that if I submit one form, the error checking is done on both, so displays error messages for both. What I need is that if form one is submit, only form ones’ error messages appear, and not form twos. Is this possible in zend?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T05:27:19+00:00Added an answer on May 19, 2026 at 5:27 am

    It isn’t a problem for zend to do – but it is a problem for you to solve!
    If you give your form a hidden field, or if you have a field ID unique to one form, you should be able to check which form has been submitted in your controller, then you tell zend which form you want it to check. Something like the following should do the job, it will check for a field with the ID unique_form_one_field which obviously should only be on form one, this could be a hidden field for example:

    // Get the forms:
    $form1 = $this->_helper->formLoader('form_one');
    $form2 = $this->_helper->formLoader('form_two');
    
    // Check if there is a POST:
    if (!$request->isPost()) 
    {
        // It isn't show the forms:
        $this->view->form_one = $form1;
        $this->view->form_two = $form2;
    }
    else
    {
        // It is, get the POST data:
        $post_data = $request->getPost();
    
        // Check if form one has been submitted:
        if (isset($post_data['unique_form_one_field']))
        {
            // Check if form one is valid:
            if (!$form1->isValid($post_data)) 
            {
                // Its got an error, display the forms again, form one will now be populated with the data and also the error messages:
                $this->view->form_one = $form1;
                $this->view->form_two = $form2;
            }
            else
            {
                // Form one was valid - do what you want to process it:
            }
        }
        else
        {
            // Check if form two is valid:
            if (!$form2->isValid($post_data)) 
            {
                // Its got an error, display the forms again, form two will now be populated with the data and also the error messages:
                $this->view->form_one = $form1;
                $this->view->form_two = $form2;
            }
            else
            {
                // Form two was valid - do what you want to process it:
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two forms on a page (one is being grabbed by AJAX). I
I have a page that has an iframe From one of the pages within
I have a page with two ContentPlaceHolders. One has a DropDown and another UpdatePanel
Many applications have grids that display data from a database table one page at
I have a struts2 application with a single page that may show one of
I have two separate websites on the same server. One site is a forum
I have two SqlDataSource controls on a page. One loads high level data and
I have a website that uses basic ASP.Net forms authentication. In the web.config file
I have one aspx page with some controls. Also i have one DIV which
Suppose I have one html page with frames. The left frame is simply a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.