title: jquery setting hidden input value not working as expected in IE7 and IE8
body: <p>Continuing adopting my code to work with IE...</p>
  
  <p>I have a hidden <code>div</code> containing a form to edit some information.  When the user selects the item to edit, this div is shown and the fields are populated with the information for the item.  That divs (in simplified terms) looks like this:</p>
  
  <pre><code>&lt;div id="editform"&gt;
  &lt;form action="" method="post" id="qform" name="qform"&gt;
      First param: &lt;input name="field1" id="field1"/&gt; &lt;br/&gt;
      Second param: &lt;input name="field2" id="field2"/&gt; &lt;br/&gt;
      ...
  
      &lt;input type="hidden" name="qid" id="qid" value=""/&gt;
  
      &lt;img id="submit" src="..." alt="..." title="..." /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I use jquery to set the values into the fields.  My function for opening up the editing div looks something like this:</p>
  
  <pre><code>function edit_item(item_id) {
      item = get_item(item_id);    //this will return a JS object
      $('#field1').val(item.property1);
      $('#field2').val(item.property2);
      ...
      $('#qid').val(item_id);
      $('#submit').click(function() {
          alert($('#qid').val());
          $('#qform').ajaxSubmit();
      });
  }
  </code></pre>
  
  <p>All of this works fine in FF, Opera, Webkit and IE 9, however in IE7 and IE8, I'm having a strange problem.  I can see the <code>item_id</code> being set correctly in the <code>edit_item</code> function, however as soon as that function completes, the hidden input value (<code>qid</code>) gets reset to the empty string.  When the form is being ajax-submitted, the alert shows the value to be an empty string despite it being set correctly.  Interestingly, all other fields are fine.  And it works correctly in IE 9.</p>
  
  <p>What am I missing here?  Many thanks in advance.</p>