Apr 11th, 2010, 9:52 AM
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:
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:
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:
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
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