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.

Inserting passed Query String values into an HTML block?

  1. I've set up a Gravity Form that passes Query String values on submit to a second Gravity Form, including FirstName, LastName as hidden fields (admin view only).

    Is it possible to dynamically insert this Query String values into an HTML block on the second form?

    i.e.:

    Hey {FirstName} - thanks for taking a look at this.

    I'm guessing no but will be pleasantly surprised if the answer is yet.

    Thanks!

    Posted 12 years ago on Thursday April 26, 2012 | Permalink
  2. kyle
    Member

    I would think you could do it with shortcodes. So you could have:

    Hey [FirstName]...

    and then you'd have to create a shortcode that converted [FirstName] into the actual firstname. Maybe something like this:

    add_shortcode( 'firstname', 'custom_firstname_shortcode' );
    
    function custom_firstname_shortcode() {
      global $_GET;
    
      return $_GET['FirstName'];
    
    }

    which assumes a url like:

    http://www.example.com/myform/?FirstName=Brian

    If you're going to parse a bunch of values, you might want to build a more generic shortcode and pass the values as arguments. Something like:

    [parsequery value="FirstName"]

    Posted 12 years ago on Thursday April 26, 2012 | Permalink
  3. Hi Kyle

    Which file needs to be edited with the function above? I need to insert a passed query string into an html block too -- the first and last name, they were passed as first_name, last_name.

    Thank you!

    Posted 11 years ago on Friday September 14, 2012 | Permalink
  4. The code Kyle posted would go into your theme's functions.php file.

    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Posted 11 years ago on Friday September 14, 2012 | Permalink

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