title: Url Query String - Passing liquid values to fill out form on another page
body: <p>On my shopify website I have a product page with a request button, that when clicked should redirect the user to another page which has a form on it.</p>
  <p>Clicking the button on the product page should pass the product title from that page to the other page and place that string variable into the form for the user to see and so that they can fill out the rest of the form with their information.</p>
  <p>This is my link:</p>
  <pre><code>&lt;a href=&quot;/pages/other-page#request-form&quot;&gt;REQUEST ITEM&lt;/a&gt;
  </code></pre>
  <p>What needs to be passed:</p>
  <pre><code>{{ product.title }}
  </code></pre>
  <p>Where it needs to be placed ( #form_text ):</p>
  <pre><code>&lt;form id=&quot;request-form&quot; method=&quot;post&quot;&gt;
      &lt;input id=&quot;first_name&quot; name=&quot;firstName&quot; placeholder=&quot;First Name*&quot; type=&quot;text&quot; value=&quot;&quot; /&gt; 
      &lt;input id=&quot;last_name&quot; name=&quot;lastName&quot; placeholder=&quot;Last Name*&quot; type=&quot;text&quot; value=&quot;&quot; /&gt; 
      &lt;textarea id=&quot;form_text&quot; name=&quot;content&quot; placeholder=&quot;What item do you want?&quot;&gt;&lt;/textarea&gt; 
      &lt;input id=&quot;requestFormSubmit&quot; type=&quot;submit&quot; value=&quot;SUBMIT&quot; /&gt; 
  &lt;/form&gt;
  </code></pre>
  <p>How would I go about writing a url query string to pass this liquid variable?</p>
  <h2>Edit:</h2>
  <hr />
  <p>Thank you to @TylerSebastion, I was able to get it to work.</p>
  <p>The link:</p>
  <pre><code>&lt;a href=&quot;/pages/other-page#request-form?product={{ product.title | url_param_escape }}&quot;&gt;REQUEST ITEM&lt;/a&gt;
  </code></pre>
  <p>Here is the code I used on the form page:</p>
  <pre><code>$(function() {
      var product = getParameterByName('product');
      $(&quot;#form_text&quot;).text(product);
  
      function getParameterByName(product) {
          url = window.location.href;
          product = product.replace(/[\[\]]/g, &quot;\\$&amp;&quot;);
          var regex = new RegExp(&quot;[?&amp;]&quot; + product + &quot;(=([^&amp;#]*)|&amp;|#|$)&quot;),
              results = regex.exec(url);
           if (!results) return null;
           if (!results[2]) return '';
           return decodeURIComponent(results[2].replace(/\+/g, &quot; &quot;));
          }
  });
  </code></pre>