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.

Dynamically pass data from static form to GravityForm ??

  1. SoundsGood
    Member

    Hi,

    Is there any way to pass along data from a static page/form to a GravityForms form?

    Here's what the "form action" code looks like on the static page:

    <form action="http://www.website.com/page?sid=1234&appname=JoeBlow" method="get">
    <input type="hidden" name="sid" value="1234" />
    <input type ="submit" name="contactme" value="more information &raquo;" class="btn es-noprint" />
    <input type ="submit" name="contactme" value="book it &raquo;" class="btn es-noprint" />
    </form>

    Basically, when someone clicks on the contactme Submit button, I want to pass the "appname=JoeBlow" info into a field within the GravityForms form. Specifically, I need "JoeBlow" to be dynamically inserted in a field in a GravityForms form.

    Can this be done? If so, how?

    Thanks!

    Posted 9 years ago on Wednesday July 14, 2010 | Permalink
  2. Yes, you can allow the fields to be pre-populated via querystring parameters. Click on the advanced tab for the field, check the "Allow field to be populated dynamically" field, then specify the name of the parameter it should receive.

    screenshot

    That's it.

    Posted 9 years ago on Wednesday July 14, 2010 | Permalink
  3. SoundsGood
    Member

    Hmm... it's not working.

    It DOES work if it's just a regular link, like so:

    Contact Us

    But NOT if it's in a form (<form action>) as shown in the original post.

    Any thoughts?

    Posted 9 years ago on Wednesday July 14, 2010 | Permalink
  4. SoundsGood
    Member

    UPDATE: I think I figured out the problem...

    Whoever wrote the code on the other form used: method="get" ... Which does NOT work.

    But if I switch it to: method="post" ... it DOES work.

    Now I gotta work on getting it switched over permanently.

    Anyway, thanks for your help, Kevin! :)

    Posted 9 years ago on Wednesday July 14, 2010 | Permalink
  5. SoundsGood
    Member

    NEW QUESTION (same topic):

    It's not going to be as easy as I'd hoped to get the other form changed to POST instead of GET.

    So... is there any way to make GravityForms accept the data from GET instead of POST ?

    Thanks.

    Posted 9 years ago on Wednesday July 14, 2010 | Permalink
  6. Gravity Forms works with GET fine. All it needs are the variables to be passed correctly via the querystring and for the form fields set correctly to receive them.

    There's something odd about your form that's apparently not passing the information correctly.

    Posted 9 years ago on Wednesday July 14, 2010 | Permalink
  7. SoundsGood
    Member

    Hmmm... well, the form code is in my original post. See anything funky in there?

    Oh, and again -- the info *DOES* pass correctly if the form is changed to POST, so it can't be *too* odd, right?

    Posted 9 years ago on Wednesday July 14, 2010 | Permalink
  8. Yeah, I saw the form from the original post and the only field that I see besides the two buttons is the "sid" hidden field which has the same value as the "sid" hard-coded in the form action. I think there's some sort of issue using the GET method with the parameters in the action link as well.

    It works as a POST because you're hard-coding parameters in the form action that still get passed like a GET

    Posted 9 years ago on Wednesday July 14, 2010 | Permalink
  9. SoundsGood
    Member

    I can't figure out what might be wrong with the form while using GET (instead of POST). Oh well.

    Kevin, I appreciate your help -- very much. Thanks!

    Posted 9 years ago on Thursday July 15, 2010 | Permalink
  10. You're very welcome. Let us know if you figure out what the deal is.

    Posted 9 years ago on Thursday July 15, 2010 | Permalink