FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two forms- same page confusion
#1
I thought that perhaps it was better/easier to break my question out as it may simply be confusion on my part and did not want to confuse the other thread as well.

So, I am trying to get multiple forms working on one page and am starting with trying to get the first two going. here is what I have for code on the forms page:

Code:
<?php
require_once("/web/home/support/docs/assets/scripts/formtools/global/api/api.php");

$fields_9 = ft_api_init_form_page(9, $pp["mode"], "form_tools_form_9");
$fields_10 = ft_api_init_form_page(10, $pp["mode"], "form_tools_form_10");
if(isset($_POST['v-docSubmit'])) {
    if ($pp["mode"] == "initialize") {
        $params = array(
            "namespace" => "form_tools_form_9",
            "submit_button" => "v-docSubmit",
            "next_page" => "entry-thanks.php",
            "form_data" => stripslashes_deep($_POST),
            "finalize" => true
        );
    } else {
        $params = array(
            "namespace" => "form_tools_form_9",
            "submit_button" => "v-docSubmit",
            "next_page" => "entry-thanks.php",
            "form_data" => stripslashes_deep($_POST),
        );
    }
    ft_api_process_form($params);
} else if (isset($_POST['vd-Submit'])) {

    if ($pp["mode"] == "initialize") {
        $params = array(
            "namespace" => "form_tools_form_10",
            "submit_button" => "vd-Submit",
            "next_page" => "entry-thanks.php",
            "form_data" => stripslashes_deep($_POST),
            "finalize" => true
        );
    } else {
        $params = array(
            "namespace" => "form_tools_form_10",
            "submit_button" => "vd-Submit",
            "next_page" => "entry-thanks.php",
            "form_data" => stripslashes_deep($_POST),
        );
    }
    ft_api_process_form($params);
}
?>

With this, I am getting a 200 error, which is saying that the second parameter I have is wrong ($pp["mode"]). I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API? Also, if the mode is not initialize, do I not still have to have finalize=>true in there as well?

Thanks for any help clearing this up.

Dave
Reply
#2
Quote: I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API?
Hi,

I believe the $pp["mode"] is set in the library.php file that comes with the Paypal demo.

Martin
Reply
#3
(Mar 21st, 2010, 3:19 PM)martin_undefined Wrote:
Quote: I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API?
Hi,

I believe the $pp["mode"] is set in the library.php file that comes with the Paypal demo.

Martin

So, this variable is really only used when interfacing with PayPal? Is it something you manually set in library.php or is it set dynamically?

Cheers

Dave
Reply
#4
Hi,

In the example and how I've used it, it's just set manually in the form:

Code:
// the Form Tools submission mode
$pp["mode"] = "live";

I think it is only used with Paypal.

Martin
(Mar 21st, 2010, 3:22 PM)filch Wrote:
(Mar 21st, 2010, 3:19 PM)martin_undefined Wrote:
Quote: I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API?
Hi,

I believe the $pp["mode"] is set in the library.php file that comes with the Paypal demo.

Martin

So, this variable is really only used when interfacing with PayPal? Is it something you manually set in library.php or is it set dynamically?

Cheers

Dave
Reply
#5
OK ... that is more or less what I did. Just seems a bit klugey ... especially if there are several forms on the page like I have.

Anyway ... thanks for your responses.

Cheers

Dave

(Mar 21st, 2010, 3:29 PM)martin_undefined Wrote: Hi,

In the example and how I've used it, it's just set manually in the form:

Code:
// the Form Tools submission mode
$pp["mode"] = "live";

I think it is only used with Paypal.

Martin
(Mar 21st, 2010, 3:22 PM)filch Wrote:
(Mar 21st, 2010, 3:19 PM)martin_undefined Wrote:
Quote: I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API?
Hi,

I believe the $pp["mode"] is set in the library.php file that comes with the Paypal demo.

Martin

So, this variable is really only used when interfacing with PayPal? Is it something you manually set in library.php or is it set dynamically?

Cheers

Dave
Reply
#6
It *is* a little klunky, you're right.

Multiple forms on a single page was something I took into account with the API, but not with the PayPal example script - that was really just designed for a single form. That said, it's quite possible as described in the other thread to get it all going; just takes a lot of fiddling....

- Ben
Reply
#7
(Mar 22nd, 2010, 8:15 PM)Ben Wrote: It *is* a little klunky, you're right.

Multiple forms on a single page was something I took into account with the API, but not with the PayPal example script - that was really just designed for a single form. That said, it's quite possible as described in the other thread to get it all going; just takes a lot of fiddling....

- Ben

I have it going ... but I cannot get the files to upload. It puts a reference in the database ... but no file is uploaded.

Any idea what might be happening here?

Dave
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)