PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Programmatically submitting a form?

  1. I'd like to be able to programmatically submit a form, entirely within a function of mine. I'm doing this to take advantage of the PayPal addon. I've been looking through the docs but haven't figured out how to do this.

    So, is there a way to do something like this? Here's some pseudo-code showing what I'd like to do:

    function my_plugin_do_payment() {
        $form = new GravityFormForm($form_id);  // get some sort of form instance
        $form->setField(1, '69.95');  // then set some product/price fields, as needed for PayPal
        $form->submit();  // submit the form, sending my user to PayPal to pay for his purchase, and firing the normal gform hooks.
    }

    Thanks,

    John

    Posted 13 years ago on Friday July 8, 2011 | Permalink