The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
multi page dependency - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: multi page dependency (/showthread.php?tid=616)



multi page dependency - Hannes - Mar 27th, 2010

I would like to add a multi page form whereby the second page depends on the input of the first page.

For example on the first page I have a drop-down with "A" and "B".
If "A" is selected it will continue with form A and if "B" is selectected it will continue with form B which is different from form A.

How must the code look like?

Thanks in advance and best regards, Hannes.


RE: multi page dependency - Ben - Mar 28th, 2010

Hi Hannes,

Sure, this can be done like this. At the top of your form, you should have something like this already there:

PHP Code:
$params = array(
  ...
  
"next_page" => "form_A.php",
  ... 
  );
ft_api_process_form($params); 

The "next_page" key lets the ft_api_process_form function know where to redirect the user to next.

What you need to do is just construct the $params variable to have a different redirect page, depending on what was entered in the form. So something like this would work:

PHP Code:
if ($_POST["dropdown"] == "A")
{
  
$params = array(
    ... 
    
"next_page" => "form_A.php",
    ...
      );
}
else if (
$_POST["dropdown"] == "B")
{
  
$params = array(
    ... 
    
"next_page" => "form_B.php",
    ... 
      );


I've omitted all the stuff that'll be specific to your form, but that's the general idea.

Hope this helps!

- Ben


RE: multi page dependency - Hannes - Apr 2nd, 2010

works like a charm...
Thank you a lot for the detailed instructions!