0
votes

Drupal 7

Webform 7.x-4.15

Example:

Webform 1: Fill up Particular

Webform 2: Category details

When a user submits the first webform 1, I have the confirmation page there I have a listing (For the first time is empty), when I click on another button that is in this page I redirect to second form here I will pass at the same time the last user ID save (SID)

How can I make a relationship between the forms (Webform 1 and Webform 2)?

Schema relationship between two forms

1
I guess you have to write php code to alter the confirmation page to display the form with values you want in form two. - Viswanath Polaki

1 Answers

0
votes

You can add custom submit callback and go to next form with it.

hook_form_alter

function MYMODULE_form_alter(&$form, &$form_state, $form_id){
  if($form_id == 'id_step_one'){
    $form['#submit'][] = '__custom_submit_function'; // add callback submit
  }

}

function __custom_submit_function($form, &$form_state){
   // do some stuff if you want 
   drupal_goto('/your_form_step2'); // redirect to step 2 of webform
}