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.

What function outputs the actual form?

  1. I am creating an addon plugin for Gravity Forms. I have the form ID I want to output in my plugin code - but what function within the Gravity Form Plugin actually outputs the form and such. I have tried this:

    GFFormDisplay::get_form($atts['form']);

    from my plugin but it does not output anything. Does anyone have any insight on this?

    Thanks!

    Posted 12 years ago on Tuesday September 11, 2012 | Permalink
  2. Please see the documentation here:
    http://www.gravityhelp.com/documentation/page/Embedding_A_Form

    [php]
    <?php gravity_form($id, $display_title=true, $display_description=true, $display_inactive=false, $field_values=null, $ajax=false, $tabindex); ?>

    That will work in a theme file. Will that work in your plugin?

    Posted 12 years ago on Tuesday September 11, 2012 | Permalink
  3. Chris,

    This may work. I need to pre-populate it with an old submission though - is there an easy way to do this pulling the info from the database? Then with the use of Gravity Forms hooks I will want to "update" the submission rather than create a new one.

    The idea is that this will be used for a My Account page.

    Thanks,
    Travis

    Posted 12 years ago on Tuesday September 11, 2012 | Permalink
  4. Duh!

    GFFormDisplay::get_form($atts['form']);

    works just fine - I didn't put RETURN before it in PHP. I still could use a pointer in the right direction about pre-population though. Is there a way to pull this easily out of the database? In your function you provided:

    <?php gravity_form($id, $display_title=true, $display_description=true, $display_inactive=false, $field_values=null, $ajax=false, $tabindex); ?>

    is there a way to get an array for $field_values easily from the database of an already submitted form I guess is what I'm asking. Thanks for being so active on this support forum!

    Thanks,
    Travis

    Posted 12 years ago on Tuesday September 11, 2012 | Permalink
  5. That sounds like a separate issue altogether. Now that we have the function to display a form in your plugin, please start a new topic for this new pre-population issue and we'll help you out there.

    Here are the different ways to pre-populate form fields:
    http://www.gravityhelp.com/documentation/page/Allow_field_to_be_populated_dynamically

    You might want the http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name filter

    Posted 12 years ago on Wednesday September 12, 2012 | Permalink

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