title: How do I insert a cookie data value into a hidden form field?
body: <p>I would like to be able to take data stored in a cookie and insert it into a hidden form value. </p>
  
  <p>I am storing the data in a cookie using the following:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function () {
          $("#btnCookie").bind("click", function () {
              $.cookie("name", $("#txtName").val());
  </code></pre>
  
  <p>I am able to retrieve the value as plain text on the next page using:</p>
  
  <pre><code>$.cookie("name")
  </code></pre>
  
  <p>I have a form on the 2nd page that I want this value to be a part of. How can I insert it into the following:</p>
  
  <pre><code>&lt;input type="hidden" name="cookie" /&gt;
  </code></pre>
  
  <p>I have tried this but it doesn't work:</p>
  
  <pre><code>&lt;input type="hidden" name="cookie" value="$.cookie("name")" /&gt;
  </code></pre>