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.

Submit Button and Sending Data

  1. I have a form on http://www.usarmyoption.com with a submit button that sends data to:
    $submit_url='http://www.wayofthearmy.com/cgi-bin/arp3/arp3-formcapture.pl';
    (This is a php file)

    I would like to have the same value in the gravityform submit button. How do I edit the submit button so I can add the url, http://www.wayofthearmy.com/cgi-bin/arp3/arp3-formcapture.pl ? Its an autoresponder.

    Regards,
    Paul

    Posted 14 years ago on Thursday May 5, 2011 | Permalink
  2. You wouldn't implement it the same way. While you can change the form action for a Gravity Form, it isn't recommended.

    When you change the form action, Gravity Forms no longer processes the form as it would now be handled by the custom action that you set. You can do this if you really want to, but we don't recommend it. But if you have to you can use the gform_submit_button hook which is documented here:

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

    The better way to handle this is to post data to that url as part of the gform_post_submission hook. Documentation for this hook is here:

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

    Posted 14 years ago on Thursday May 5, 2011 | Permalink
  3. Have you tired seprating the URLS with a commar? Might work?

    i.e. $submit_url= 'url1' , 'url2'

    Posted 14 years ago on Thursday May 5, 2011 | Permalink
  4. So how would i add the url http://www.wayofthearmy.com/cgi-bin/arp3/arp3-formcapture.pl inside the form_display.php? The code below is what is supposed to be in form_display.php
    Where would http://www.wayofthearmy.com/cgi-bin/arp3/arp3-formcapture.pl be located in the code? I am not sure.

    <?php

    02 add_action("gform_post_submission", "set_post_content", 10, 2);

    03 function set_post_content($entry, $form){

    04

    05 //getting post

    06 $post = get_post($entry["post_id"]);

    07

    08 //changing post content

    09 $post->post_content = "Blender Version:" . $entry[7] . "
    <img src='" . $entry[8] . "'>

    " . $entry[13] . "
    <img src='" . $entry[5] . "'>";

    10

    11 //updating post

    12 wp_update_post($post);

    13 }

    14 ?>

    Regards,
    Thanks for your help
    Paul

    Posted 14 years ago on Friday May 6, 2011 | Permalink
  5. You wouldn't edit form_display.php. You wouldn't edit any of the Gravity Forms plugin files. Customizations are done using hooks and filters without modifying Gravity Forms itself.

    As I mentioned in the post above the ideal way to do this is using the gform_post_submission hook to execute whatever custom code you need to execute when the form is submitted. You would place this custom code either in your themes functions.php file or in a custom plugin you create. You wouldn't place it in a Gravity Form plugin file or form_display.php.

    It's not just a matter of placing that URL in the file. You need to use PHP to post data to that URL. So you need to know how to do that using PHP. If this isn't something you know or understand then you may want to hire a WordPress developer with Gravity Forms customization experience to assist you with this.

    Here are some you can try contacting:

    Ounce of Talent
    http://www.ounceoftalent.com

    WebDevStudios
    http://www.webdevstudios.com

    Scott Kingsley Clark
    http://scottkclark.com

    Posted 14 years ago on Friday May 6, 2011 | Permalink