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.

Pre-Populate hidden field with referral information / the previous URL

  1. Hey there!

    I am busy using the forms and would love to have a destinct feature:

    I want to have a kind of "referral-system" incorporated with my order-form. This means essentially, that I want to know which domain/URL the User came from before filling out my form. I know this can be done with GA & goals similarly, but I am looking for a more convenient way, giving me all the information upon reading the (future) client's request.

    I already tried a little jQuery-script (see http://www.gravityhelp.com/forums/topic/previous-url-post-into-field) but either it is "printed" into the first visible field (input:eq(0) - I tried admin-only without any luck) or not working (when using the CSS-workaround, both admin-only and hidden).

    Looking forward to some insights here. Thanks in advance!


    For reference, this is my CSS-edit (placed in header.php) - maybe there is an error and it would all work out the way I intended?

    <script>
    jQuery(document).ready(function() {
        var referral = "<?= urldecode($_GET['referral']); ?>";
        jQuery('.gform_wrapper .referral').val(referral);
    });
    </script>
    Posted 12 years ago on Tuesday February 14, 2012 | Permalink
  2. Hi, leanderb,

    I have a few questions.

    Do you already have the domain/URL and are passing "referral" in the querystring to your form?
    Where do you want the domain/URL stored, with the entry?
    Is it only supposed to be visible in the admin?

    Posted 12 years ago on Thursday February 16, 2012 | Permalink

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