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.

Gravity Submit form to external location (formtools.org)

  1. bari86
    Member

    What I am trying to do is when my gravity form submits, the form will post data to external url. I am using formtools.org script as my database management.

    I tried to use solution from:
    http://www.gravityhelp.com/forums/topic/cant-find-any-instructions-to-post-form-data-to-external-url

    But was not able to solve the problem. I want to use the formtools.org script to handle my gravity form. What I want it the form to submit to gravity own system (optional) and also my formtools script that I am currently using.

    The form requested me to put this in the form:
    http://www.pastie.org/private/j96sb52zpnlcwiss87ef9g

    So i has modified the functions.php to include:
    http://www.pastie.org/private/1iwxj0dikvcq0v2cdf2c7a

    in my Form Setting, under the confirmation tab, I configure the confirmation message to be 'page' and put in my thank you page. I notice there are 'redirect' and 'Pass Field Data Via Query String' but not sure how to configure that.

    my form url is http://istv2.institutskilltech.com/?page_id=181

    Please help.

    Posted 14 years ago on Wednesday June 15, 2011 | Permalink
  2. You would have to write custom code and use the gform_post_submission hook to do this. You can't change the form action because Gravity Forms manages the data. So you can use the gform_post_submission hook, which has access to the Entry object containing the data, and execute any PHP code you want using this data... including posting it to a 3rd party location.

    Documentation for the gform_post_submission hook can be found here:

    http://www.gravityhelp.com/documentation/page/Gform_post_submission

    Documentation for the Entry object can be found here:

    http://www.gravityhelp.com/documentation/page/Entry_Object

    You would place your custom code in your themes functions.php file.

    Posted 14 years ago on Wednesday June 15, 2011 | Permalink
  3. bari86
    Member

    I only need to put in custom code in functions.php right? as far as what I can see in the documentation, i on the right track. i really not sure where went wrong.

    Posted 14 years ago on Thursday June 16, 2011 | Permalink
  4. Yes, your custom code would go in your themes functions.php file. You could also place it in a custom plugin that you create and then activate, but that is up to you. Usually easier just to place it in functions.php.

    Posted 14 years ago on Thursday June 16, 2011 | Permalink
  5. bari86
    Member

    I still cannot get it working. Help! I have put in the custom code into my functions.php. This is what I have added to my functions.php. My Gravity form id is 1. Please help as I tried your form plus other plugin but none can solve my problem. I have spend 1 whole day to solve this. I need the form to submit to my existing formtools.org database.

    For the input text i purposely use 'text' and 'hidden' just to check whether it does affect the form submission.

    http://www.pastie.org/private/vqjkwwbsaj1fqkq0k1yv9a

    Posted 14 years ago on Thursday June 16, 2011 | Permalink
  6. I am not familiar with formtools.org or how to use it or integrate with it to know if your code is correct or not. This is a customization so you would need to hire a developer to assist you with this if you are having problems.

    Posted 14 years ago on Thursday June 16, 2011 | Permalink
  7. bari86: did you solve this one yet? I am looking to do something similar (post to external form)

    It looks like your code simply populates a new <form> with data. It's not doing any actual submitting. I think you should be able to use Wp_http to submit the form via a post.

    Some info: http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/

    if I solve my problem, I'll share it here!

    Posted 14 years ago on Wednesday July 20, 2011 | Permalink