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.

Check Info

  1. I have created a form (https://secure.growingstage.com/?page_id=2) which I have setup and custom encoded to allow me to hide certain values from the database and use pgp encryption (which was much easier than I thought it would be at first). What I am trying to do is create a page for people who are buying something to check their data. I know that this functionality is not included in the default setup, but I am not new to intense PHP and jquery coding. I noticed that a number of the field types have the ability to be dynamically updated and I wanted to know if there is a way to populate a text field on "page 3" of my form using the data from a text field on "page 1" of my form. If yes, then I can do the rest. Thank you for your help in advance!!!!!

    Posted 13 years ago on Monday August 29, 2011 | Permalink
  2. Hi Mgdir,

    Yes this is definitely possible. The easiest way to do this is going to be using the gform_pre_render hook. You can retrieve the the submitted value of any field using the rgpost('field_name') function. Example:

    [php]
    $value = rgpost('input_1');

    One catch. The gform_pre_render hook will fire with every form page load. This will cause issues if after the user gets to the third page, changes the field value from the prepopulated value and then moves on to the fourth page. When the gform_pre_render hook fires on the fourth page load, it will prepopulate the original field value again instead of keeping the updated value.

    The solution to this is getting the current page (code below) and make sure that you do not fire the prepopulation code once you are past the page the field you are prepopulating resides on.

    [php]
    $current_page = rgpost('gform_source_page_number_' . $form['id']) ? rgpost('gform_source_page_number_' . $form['id']) : 1;
    Posted 13 years ago on Tuesday August 30, 2011 | Permalink

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