Creating 2 forms to work together on the same page for the same query I'm facing trouble coming up with the following approach:

I will have 3 separate forms acting on the same query from third party API's.

On the front page there is a shorter quick-form that would lead to the page of the other 2 forms. In some cases the information from the first form is sufficient to query the information and the information will be queried.

In other cases additional input from the second form is required to make the query. The third form is for fine-tuning an existing query.

The first form isn't an issue, it's a separate block on the front page that will store the information internally for the second form to see with multiform functionalities and on submit redirect to the second forms page, where the form can process the information and see if a query can be made or will give results and go ahead with it, if not, then ask for further input.

The second and third form are on the same page, where the second form has necessary input fields for the query, which can also be changed to change the results, and the third form is just for fine-tuning this query like a filter or so.

Right now I'm stuck with the second 2 forms working together on the same page, being separate forms but altering the same query/information. And would appreciate all and any help with this approach that would be "the Drupal way".

Better visualization:

Imagine a flight booking site: first form is your departure airport that takes you to the second 2 forms, where already a lot of flights from your airport can be displayed, second form takes in a destination, dates and passengers; the third form would let you fine-tune travel class, meals, airlines to avoid airlines preferred, how many layovers, how long layovers and so on..

All the information with each form is queried from different airline API's and will have to be redone on every change.
From your question... you are saying you have 3 forms...

The first form (on its own page) leads to the other 2 forms (which are on a different page, but both forms are on that single page)... it's not completely clear what the problem is - only that both forms are supposed to alter a query, but this is not happening?

Perhaps you could place the fields for both forms in a single form and assign different actions to each of the submit buttons... technically there will only be one form, but visually through styling you can make it appear as two separate forms through CSS - for example using tabs where the fields for the first form is on the first tab... and the fields for the second form is on the second tab... the first tab would have a submit button defined like this:

        $form['submit1']=array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Submit form 1'),
        '#submit' =&gt; array('::processForm1'),
        );


and on the second tab you can define another submit button:

        $form['submit2']=array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Submit form 2'),
        '#submit' =&gt; array('::processForm2'),
        );


Enough to say in the form object, you will need to define both the processForm1 function and the processForm2 function... in order to decipher which button triggered the submit in the formValidation and formSubmit functions you will use a line such as:

      $trigger=$form_state-&gt;getValue('op');


where $trigger will hold the label of the triggering button.

Hope that helps and makes sense.