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.

Complete a field with a variable value

  1. I have a form with a textarea field and I would like to complete the textarea value with a variable, is it possible to do it with GF?

    In this case I will access the form with a URL like these: http://www.myweb.com/realizar-pedidos/?o=22
    Then, on my page I will request the o variable ($my_var = $_GET['o']) and then I would like to fill my textarea field with $my_var value.

    Thanks!

    Posted 12 years ago on Wednesday January 11, 2012 | Permalink
  2. I believe you want to use the gform_field_value filter to populate the form field before the form is rendered.

    http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name

    Your example though shows using the query string to grab the value of "o" - but it's just two characters. If you want to populate a text area with just the value of that parameter in the query string, all you need to do is on the advanced tab of your form field, check the box "Allow field to be populated dynamically" then fill in the "parameter name" with "o" (no quotes) then use the URL as you have shown it, and the value of "o" will be placed in the value for the text area.

    Do either of those solutions help you?

    Here is more information about how you can pre-populate fields:
    http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population

    Posted 12 years ago on Wednesday January 18, 2012 | Permalink