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.

Passing $POST variable

  1. I'm trying to pre-populate a form with a high score field. A user plays the game and the score is updated inside a form as $_POST['score'], I have set the form action to my page with the Gravity form on. Can i then use that $_POST['score'] to prepopulate my high score field inside my gravity form?

    If not is there a way to do this better?

    So game on one page high score presented at end (I can get this however we need to)
    Form on another need to pass high score through?

    Posted 12 years ago on Wednesday May 9, 2012 | Permalink
  2. David Peralty

    If you put it as a query string, you can easily use the dynamically populate fields ability in Gravity Forms to pull it form the URL into the form.

    Posted 12 years ago on Wednesday May 9, 2012 | Permalink
  3. Is there anyway to pass it as a hidden variable though, putting it in the query string means anyone can update it manually.

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  4. David Peralty

    You would have to use:
    http://www.gravityhelp.com/documentation/page/Gform_pre_render

    To grab your post variables and populate your field(s).

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  5. hope you dont mind grabbing your topic.

    If the data is dynamic, will the form have to be refreshed to get the new data? or will it change dynamically as well.

    Mark

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  6. David Peralty

    My assumption is that he has the game on one page, and posts it to another, thus the form doesn't receive it dynamically as the person is playing, but only after they've won or lost.

    Posted 12 years ago on Thursday May 10, 2012 | Permalink