1

I have built a multistep form, and it works fine.

Now I have installed LoginToboggan module, It has the option of show a unified login/registration form.

I would like to set the last step of my multistep form to this LoginToboggan form. I don't mean redirect the user to the /user/login page, I mean show it in the same path.

Is that possible?

I am trying different variations of this code, but nothing is working:

function simpleexample_menu() {
  $items['simple-example-page'] = array(
    'title' => 'Simple Multi-Step Form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('simpleexample_form_wrapper'),
    'access callback' => TRUE,
  );

  return $items;
}


function simpleexample_form_wrapper($form, &$form_state) {
  if (empty($form_state['page_num'])) {
// Build page 1
    return simpleexample_form_page_one($form, $form_state);
  }
  elseif ($form_state['page_num'] == 2) {
// Build page 2
    return simpleexample_form_page_two($form, $form_state);
  }
  elseif ($form_state['page_num'] == 3) {
// Build unified login/registration form
   return logintoboggan_unified_login_page();
  }
  return $form;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.