• Resolved shocktech11

    (@shocktech11)


    Great product guys!
    There is one feature I’m missing and find it would be very useful:
    * Ability to insert dynamic values into the contact page that are taken from URL parameters.

    For example:

    This url
    http://www.example.com/contact-form/?product=shirts&color=red

    should open a Contact Form page which looks something like this:

    “Contact us to get the latest collection of [color] [product]!”
    which translates into:
    “Contact us to get the latest collection of red shirts!”

    So there is no need to create thousands of product-specific contact-us pages!

    Hope to see this feature in the future releases.

    https://wordpress.org/plugins/pwebcontact/

Viewing 1 replies (of 1 total)
  • Plugin Author Gator Forms Support

    (@perfect-web-support)

    Hello,

    actually you can do this with a little JavaScript/jQuery and Regular Expressions. Please put this code into Custom text/html field:

    Contact us to get the latest collection of <span id="color"></span> <span id="product"></span>

    then put the following code to Location & Effects > Form before opening > Advanced > JavaScript on load event:

    function getURLParameter(name) {
      return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
    }
    color = getURLParameter('color');
    product = getURLParameter('product');
    jQuery("span#color").text(color);
    jQuery("span#product").text(product);

    Replace all occurences of color and product with names of your URL parameters.

    Best regards

Viewing 1 replies (of 1 total)

The topic ‘Dynamic content generated by URL parameters’ is closed to new replies.