Mar 20th, 2010, 9:09 AM
(Mar 10th, 2010, 6:00 AM)Jaace Wrote: <snip>
would this be how I get the namespace all set up for my example? :
Code:$fields_8 = ft_api_init_form_page(8, $pp["mode"], "form_tools_form_8");
$fields_9 = ft_api_init_form_page(9, $pp["mode"], "form_tools_form_9");
if (isset($_POST['form_9_submit'])) {
if ($pp["mode"] == "initialize") {
$params = array(
"namespace" => "form_tools_form_9"
"submit_button" => "send",
"next_page" => "/form-9-success",
"form_data" => stripslashes_deep($_POST),
"finalize" => true
);
} else {
$params = array(
"namespace" => "form_tools_form_9"
"submit_button" => "send",
"next_page" => "/form-9-submit",
"form_data" => stripslashes_deep($_POST),
);
}
ft_api_process_form($params);
} else if (isset($_POST['form_8_submit'])) {
if ($pp["mode"] == "initialize") {
$params = array(
"namespace" => "form_tools_form_8"
"submit_button" => "approve",
"next_page" => "/form-8-success",
"form_data" => stripslashes_deep($_POST),
"finalize" => true
);
} else {
$params = array(
"namespace" => "form_tools_form_8"
"submit_button" => "approve",
"next_page" => "/form-8-submit",
"form_data" => stripslashes_deep($_POST),
);
}
ft_api_process_form($params);
}
And then on my "Thank you" and "Cancel" pages I would have either:
Code:ft_api_clear_form_sessions("form_tools_form_9");
or
Code:ft_api_clear_form_sessions("form_tools_form_8");
I am trying to do the same thing and just a bit confused about the $pp["mode"] parameter. Does this value get passed from the API depending on where you are in the process of setting up your form? Or, do we have to add the value somewhere here? I tried leaving this statement as the following:
Code:
$fields_10 = ft_api_init_form_page(10, $pp["initialize"], "form_tools_form_10");
Code:
$fields_10 = ft_api_init_form_page(10, "initialize", "form_tools_form_10");
Sorry if I am being dull, but how did you set that value?
Dave