title: Set value of hidden field in a form using jQuery's ".val()" doesn't work
body: <p>I've been trying to set the value of a hidden field in a form using jQuery, but without success. </p>
  
  <p>Here is a sample code that explains the problem. If I keep the input type to "text", it works without any trouble. But, changing the input type to "hidden", doesn't work !</p>
  
  <pre><code>&lt;html&gt;
  
      &lt;head&gt;
          &lt;script type="text/javascript" src="jquery.js"&gt;
          &lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $(document).ready(function() {
                  $("button").click(function() {
                      $("input:text#texens").val("tinkumaster");
                  });
              });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;p&gt;
              Name:
              &lt;input type="hidden" id="texens" name="user" value="texens" /&gt;
          &lt;/p&gt;
          &lt;button&gt;
              Change value for the text field
          &lt;/button&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I also tried the following workaround, by setting the input type to "text" and then using a "display:none" style for the input box. But, this also fails !
  It seems jQuery has some trouble setting hidden or invisible input fields.</p>
  
  <p>Any ideas? Is there a workaround for this that actually works?</p>