The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (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.31 (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.31 (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.31 (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.31 (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.31 (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.31 (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.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
How to check for successful submission - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: How to check for successful submission (/showthread.php?tid=648)



How to check for successful submission - st8 - Apr 11th, 2010

Hey Ben,

Is there a way to check that a form entry has successfully entered the form tools admin?

I have a 2 step form on my website. Step1 is using form tools to capture the data and step2 is sent, without formtools, to a clients database. This may sound odd but it is necessary (I know formtools manages multi step forms) and is a great solution for me so thank you for formtools!

My formtools form has just 3 fields and my simple solution was this:

Code:
<?php

if (!empty($fields["Firstname"]) && !empty($fields["Lastname"]) && !empty($fields["Email"]))

    {
        include('clients-form.php');
    }
    
    else
    
    {
        include('formtools-form.php');
    }
    
?>

This works if all the fields have been filled in correctly. However, if the server side validation needs to kick in, then it causes problems. Based on the code above, even is any of these fields fail validation their variables are still not empty.

So instead all I need is something like this:

Code:
<?php

if ("submission has entered formtools backend")

    {
        include('clients-form.php');
    }
    
    else
    
    {
        include('formtools-form.php');
    }
    
?>

Thanks in advance for your help and hopefully a solution! :-D
I think I have just realized a solution. To check that the data is finalized?

I have set the API to finalize the data when the users get to the clients form.

Ok, just figuring out a way to test that. I know finalize is in the $params array.

I'll post back if I figure out how to do it but if anyone views this and I haven't replied can you please tell me how to, as it means I am stuck.

Thanks! Steven
Ok, I can't figure out how to get to the finalize variable to check that the submission hasn't been finalized yet. However, I think I have come up with a temporary solution. Though I don't like it much.

Just found out that the $_SESSION['form_tools_form'] key seems to only include the values of the form fields if the form has been finalized. So I have come up with this code and it works for me:

Code:
<?php
if ($_SESSION['form_tools_form'][submit] == "Continue")
    {
        include(TEMPLATEPATH.'/client-form.php');
    }
else
    {
        include(TEMPLATEPATH.'/formtools-form.php');     
    }    
?>

The submit field is my forms' submit button and seems to only get passed in the $_SESSION['form_tools_form'] key when the form has been finalized. I have used this as I know that the button always has the value of "Continue".

So this is a round about way of finding out that the form entry has been finalized and I can include the correct files.

If there is a better way, such as directly checking to see if it has been finalized, please let me know.

Thanks again