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.

How To Populate Input With Form Data

  1. I have a form where people enter some stuff. Then on submission it takes them to a forum page with a separate field on the page (not a gravity form generated field.)

    I want to "grab" the input from one of the fields on my gravity form and then have it populate that field on the next page.

    Here's what I have most recently...

    $resource_url = null;
    add_action('gform_after_submission_7', 'resource_submission_handler', 10, 2);
    function resource_submission_handler($entry, $form){
    	$GLOBALS['resource_url'] = $entry['30'];

    Then I have this on my other page — the one I want to populate...

    <input type="text" value="<?php echo $GLOBALS['resource_url']; ?>" tabindex="<?php bbp_tab_index(); ?>" name="resource_url" id="resource_url"/>

    If I change "null" to something it will put that something in. But I can't get it to update based on the input of the gravity form.

    Here's hoping some weekend warriors will help out! ;)

    Posted 9 years ago on Saturday July 21, 2012 | Permalink
  2. Can you dump the $GLOBALS array in your bbPress template page and see what it contains? My knowledge of the $GLOBALS variable is not strong, but I don't think you can populate it like that. I thought it would be more like this:

    $resource_url = $entry['30'];

    And then you retrieve it in the same way.

    Posted 9 years ago on Sunday July 22, 2012 | Permalink
  3. Thanks Chris!

    I figured it out actually using PHP session variables. It let me do a bit "more" than I had expected to do with it.

    I will post the code later — i.e. after I've slept.

    Posted 9 years ago on Sunday July 22, 2012 | Permalink
  4. Glad you were able to resolve that using a PHP session. Thanks for the update. I'll leave this open until you post your code.

    Posted 9 years ago on Monday July 23, 2012 | Permalink
  5. @parkeast how did you populate data from gravityform into forum in bbpress?

    Posted 9 years ago on Friday August 10, 2012 | Permalink
  6. @xefri, you can find @parkeast's website information on their profile page if you'd like to contact them directly.

    Posted 9 years ago on Friday August 10, 2012 | Permalink
  7. Yes... and please feel free to do so.

    Posted 9 years ago on Thursday August 16, 2012 | Permalink

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