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.

Text Box Population

  1. Dipity
    Member

    Hey there - I'm desperately wondering if Gravity forms can be customised in any way for the following 2 features - if it can, I'll purchase a license right now. Time is of the essence, as they say!

    I need to be able to have the dynamic information pre populated as the default value within a text box. Example: "Please send me more information on {page_title} {category}". Hopefully that makes sense!

    Secondly, and I'm assuming the addon does this already, after looking at your demo site - {embed_url} in the email settings, I'm assuming that would echo the URL the user submitted the form from?

    Thanks in advance!

    Posted 15 years ago on Monday September 28, 2009 | Permalink
  2. Currently you cannot pre-populate form fields dynamically. This feature will be available in the upcoming 1.2 release. You will be able to pre-populate form field values using query string parameters, hooks, shortcodes and function calls. So while you can't do it now, you will be able to do it in the next version release.

    As for the embed_url, yes that displays the URL of the page/post they submitted the form from.

    Posted 15 years ago on Monday September 28, 2009 | Permalink
  3. Dipity
    Member

    Ah, so now the all important question - roughly how long till 1.2?

    If you have an idea, that is :)

    Posted 15 years ago on Monday September 28, 2009 | Permalink
  4. We are wrapping up development and testing on 1.2 this week and it should be released sometime next week.

    Posted 15 years ago on Monday September 28, 2009 | Permalink
  5. Dipity
    Member

    Just a quick bump for this - I see the beta for 1.2 is out there - and I watched the screencast on the dynamic population.

    My question is (since I didn't see it in the screencast, that was more about adding URL parameters) will something like:

    "Please send me more information on {page_title} {category}"

    definitely work within a multi line text box in 1.2?

    Posted 15 years ago on Wednesday October 7, 2009 | Permalink
  6. It will work, but not the way you have outlined. Those variables aren't going to work as default text values. Gravity Forms won't know what they are. The values you want to pre-populate a form with would first have to be passed to the form.

    Form fields are pre-populated via querystring parameters, api hooks, shortcodes or function calls.

    Depending on how you are using the forms you would have to either pass the page_title and category id to the form via a querystring when linking to the form, or if you are calling the form on the same page as the page_title and category you want to display you would have to either use the API Hooks or the Function call to pass the information to the form.

    The variables you see for email notifications, etc. (ex. {embed_url}) are Gravity Forms specific variables.

    I will get a code snippet for how to pre-populate the field using a filter and post it later today. You would have to put this code snippet in the WordPress theme template file the form is called on.

    Posted 15 years ago on Wednesday October 7, 2009 | Permalink
  7. Dipity,
    Carl forgot to mention that you can also use the shortcode to pass the page title and category to the form if the form. Something like:
    [gravityform id=1 field_values="page_title=Contact Us&Category=10"]

    Posted 15 years ago on Wednesday October 7, 2009 | Permalink
  8. Dipity
    Member

    As long as it's doable, thats all I need to know :)

    As a note, the form will always be on the same page as I want the title from, as an example:

    Think of it as a product catalogue, with a tabbed enquiry form on each product page, and say you're on the page for Blue Widgets (which has a Title of 'Blue Widgets'), the enquiry form text box would say:

    Please send me more information on Blue Widgets!

    Posted 15 years ago on Thursday October 8, 2009 | Permalink
  9. @Dipity if each of the products is in fact it's own Page/post and you are displaying the form within the body of the Page/Post content using the shortcode then Alex's example would work fine.

    If you are calling the form in via a theme template file you would need to use the function call or API filter to accomplish this.

    It really depends on how you are doing things.

    Posted 15 years ago on Thursday October 8, 2009 | Permalink
  10. Dipity
    Member

    Each product does have it's own page OR post.

    Sorry forgot to ask - [gravityform id=1 field_values="page_title=Contact Us&Category=10"]

    Can page_title be replaced dynamically with the page title in the code above, providing the form is within a page/post?

    Or will I need 1 form for every single post eg:

    [gravityform id=1 field_values="page_title=Blue Widgets"]
    [gravityform id=2 field_values="page_title=Red Widgets"]
    [gravityform id=3 field_values="page_title=Green Widgets"]

    I do apologise for all these dumb sounding questions, but I need to ensure it will do what I want before purchasing - and I really appreciate the replies so far.

    Posted 15 years ago on Thursday October 8, 2009 | Permalink
  11. You can re-use the same form id and show the same form. Then you just pass the field values pretty much exactly as you outlined above.

    Keep in mind this will only work beginning with the 1.2 beta release that is available to existing customers.

    Posted 15 years ago on Thursday October 8, 2009 | Permalink
  12. How do you do this with the gravity_form() function instead of the shortcode?

    Posted 14 years ago on Thursday October 7, 2010 | Permalink
  13. @sevendayweekend - I answered this on your other post.

    http://forum.gravityhelp.com/topic/how-do-i-send-dynamic-values-with-the-gravity_form-function#post-10887

    Posted 14 years ago on Thursday October 7, 2010 | Permalink