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.

Automatically Insert the Title of the post/page into a Gravity Form Field

  1. I have a form used for "Writing a review". Currently the field labelled "product" is not dynamic and the user needs to write in the name of the product. As this form exists on each product page, I would like to change this field to dynamically pull the title of the post [ title() ] into the field.

    Is this possible and if so, how would I go about doing it?

    Thanks
    Stan

    Posted 12 years ago on Sunday February 5, 2012 | Permalink
  2. Hi Stankobrin,

    Here are two articles about dynamic population that will be helpful:

    http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population
    http://www.gravityhelp.com/documentation/page/Dynamically_Populating_the_Post_Author

    After reading these, let me know if you have any questions for me. :)

    Posted 12 years ago on Saturday February 11, 2012 | Permalink
  3. Hi David

    Apologies for the delay in coming back to you, project was put on hold until today.

    I have created the hook in the functions.php but I am a little unsure as to what to place in the actual 'Allow field to be populated dynamically(?)' field on the gravity form?

    Any further assistance would be appreciated.

    Posted 12 years ago on Wednesday April 11, 2012 | Permalink
  4. You would use whatever parameter name you'd like. The important piece is updating the filter name to match your parameter name. For example, a parameter name of "first_name" would result in a filter name of "gform_field_value_first_name".

    In the example in the "Dynamically Populating the Post Author" walk through, you'll see that the filter name is "gform_field_value_author_email". This would use the parameter name of "author_email".

    Posted 12 years ago on Wednesday April 11, 2012 | Permalink