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.

Action A PHP Script upon form submission using an external php script

  1. Hi I wonder if anyone can help me?
    I've got a call to action gravity form setup on my website where customers can enter their UK postcode and click submit. The user is then re-directed to another gravity form where they can complete their request. I've setup dynamic population so the input entered into form 1 gets populated in the second form.

    For Form 1 - when a user enters data & clicks submit (Before user is directed to form 2)
    Upon submit I would like to action an external php script which would validate the user entry.

    I've tried various filters and actions But I just can't figure out how to action the PHP script.

    Link to form1 is the main page

    When I input data and click submit I get the following error -There was a problem with your submission. Errors have been highlighted below.

    I'm not a web developer & can't afford to hire one, If someone can offer any assistance I would greatly appreciate it -

    This is what I've done or got -

    //Code is placed in the themes function.php file
    My PHP code can be seen here -

    Posted 10 years ago on Thursday June 27, 2013 | Permalink
  2. I'll see if the dev team can spot anything here for you.

    Posted 10 years ago on Friday June 28, 2013 | Permalink
  3. Thanks, just so you are aware, I have removed the code from my functions.php file because it's causing errors.


    Posted 10 years ago on Friday June 28, 2013 | Permalink
  4. Hi, Dustin,

    In looking at the code you provided, the best thing to do is include all the logic for the validation within the checkPostcode that you are calling from the gform_validation hook. And if the validation fails for your field, you need to set the failed validation for it and the failed validation message, like in the code example in the documentation located here: . Take a look at that documentation and see if that gets you further.

    Posted 10 years ago on Monday July 1, 2013 | Permalink

This topic has been resolved and has been closed to new replies.