title: Checkboxes not submitting after being changed with jquery
body: <p>I have a form with a bunch of checkboxes and input fields.  I'm using jquery(1.10.1) to manipulate a number of things about the form based on user input from another form on the page.  This was all working a few weeks ago but suddenly I've found that none of the checkboxes are submitting after they are changed by jquery.</p>
  
  <p>The checkboxes are of the form:</p>
  
  <pre><code>&lt;input type="checkbox" id="prod_70" name="prod[70]" class="product style_1 color_1 lens_3 status_1 " value="1" checked /&gt;
  </code></pre>
  
  <p>My Jquery code looks the other form to decide which boxes the user is interested in and then creates a selector based on that and the classes assigned to the checkboxes checking the boxes requested by the user:</p>
  
  <pre><code>$(curSel).prop('checked',true);
  </code></pre>
  
  <p>I was using:</p>
  
  <pre><code>$(curSel).attr('checked','checked').prop('checked',true);
  </code></pre>
  
  <p>But simplified since that shouldn't be necessary.  I also tried adding a .change() for good measure but that didn't solve the problem so I took it back out.</p>
  
  <p>When I submit the form none of the checked checkboxes show up and $_POST['prod'] (PHP on the backend) isn't there.  $_REQUEST['prod'] is also not there.  The other fields on the form are submitting.  And if I submit the form without letting jquery update anything then the checkboxes do submit and $_POST['prod'] is as expected.</p>
  
  <p>I've used the console in chrome and firebug in firefox to inspect the checkboxes while interacting with the page and 'checked' is being added and removed and the checkboxes are displaying correctly even when they're not submitting.</p>
  
  <p>I've checked the HTML on the page to make sure everything is valid and there aren't any missing close tags or nested tags and the only other JS on the page are for FB's like button and twitters follow button.  </p>
  
  <p>I'm at a loss as to what could be causing this and my searches aren't turning up anything similar anymore.  </p>
  
  <p>EDITING TO ADD MORE:</p>
  
  <p>After more debugging it appears that the problem isn't with changing the checkboxes.  It's happening when the <code>&lt;li&gt;</code> that the checkboxes are in is hidden with  .hide() and then reshown with .show().  After doing that the checkboxes in the <code>&lt;li&gt;</code> are never submitting even though other form elements inside the <code>&lt;li&gt;</code> are.  Here's a full <code>&lt;li&gt;</code>:</p>
  
  <pre><code>&lt;li class="prod style_1 color_1 lens_7 status_1  bulk-list-item" id="prod_55"&gt;
      &lt;div class="bulk-prod-name"&gt;
          &lt;input type="checkbox" id="prod_55" name="prod[55]" class="product style_1 color_1 lens_7 status_1 " value="1" /&gt;
          &lt;label for="prod_55"&gt;
              &lt;span class="style-name"&gt;Player&lt;/span&gt;
              &lt;span class="color-name"&gt;Matte Black&lt;/span&gt; |
              &lt;span class="lens-name"&gt;Rose Hi-Def LTD 17/35&lt;/span&gt;
              &amp;nbsp;&amp;nbsp;
              &lt;span class="part-number"&gt;PLMBHD03&lt;/span&gt;
              &lt;div style="margin-top:10px;"&gt;
                  &lt;span class="bulk-prod-status"&gt;Status: &lt;b&gt;In Stock&lt;/b&gt;&lt;/span&gt;
              &lt;/div&gt;
          &lt;/label&gt;
      &lt;/div&gt;
      &lt;div class="bulk-prod-image"&gt;
          &lt;div style="position:absolute; top:0;"&gt;&lt;img style="width:100%;" src="/art/products/11/1/frame/thumb/1.png"&gt;&lt;/div&gt;
          &lt;div style="position:absolute; top:0;"&gt;&lt;img style="width:100%;" src="/art/products/11/1/lens/thumb/7.png"&gt;&lt;/div&gt;
          &lt;div style="clear:both;"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="bulk-prod-price"&gt;
          MSRP: $ &lt;input type="text" id="prod_msrp_55" name="prod_msrp[55]" class="msrp inputbox" value="179.00" prod_id="55"&gt;
          &lt;input type="hidden" id="prod_msrp_orig_55" class="orig_price" value="179.00" orig_id="prod_msrp_55"&gt;
          &amp;nbsp;&amp;nbsp;&amp;nbsp;
          Dealer Price: $ &lt;input type="text" id="prod_dprice_55" name="prod_dprice[55]" class="dprice inputbox" value="90.00" prod_id="55"&gt;
          &lt;input type="hidden" id="prod_dprice_orig_55" class="orig_price" value="90.00" orig_id="prod_dprice_55"&gt;
      &lt;/div&gt;
      &lt;div class="bulk-prod-edit"&gt;
          &lt;a href="/admin/add_product.html?product[prod_id]=55&amp;product[is_edit]=1"&gt;Edit&lt;/a&gt; this product.
          &lt;div style="display:none" id="files_55"&gt;
              &lt;table width=100%&gt;
                  &lt;tr&gt;
                      &lt;td width=50% valign=top&gt;&lt;small&gt;Fullsize:&lt;br&gt;
                          &lt;span style="color:#009900"&gt; /art/products/11/1/frame/full/1.png&lt;/span&gt;&lt;br&gt;
                          &lt;span style="color:#009900"&gt; /art/products/11/1/lens/full/7.png&lt;/span&gt;&lt;br&gt;
                          &lt;/small&gt;
                      &lt;/td&gt;
                      &lt;td width=50% valign=top&gt;&lt;small&gt;Thumbnais:&lt;br&gt;
                          &lt;span style="color:#009900"&gt; /art/products/11/1/frame/thumb/1.png&lt;/span&gt;&lt;br&gt;
                          &lt;span style="color:#009900"&gt; /art/products/11/1/lens/thumb/7.png&lt;/span&gt;&lt;br&gt;
                          &lt;/small&gt;
                      &lt;/td&gt;
                      &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>And here's the full jQuery that's hiding/showing/checking/unchecking things:</p>
  
  <pre><code>    $(document).on('change', '.prod_selector', function(e) {
  //      console.log('Selection changed:');
          e.preventDefault();
          $('.prod').hide();
          $('.product').prop('checked', false);
          var lens = $('#lens_selector').val();
          var color = $('#color_selector').val();
          var style = $('#style_selector').val();
          var pstatus = $('#status_selector').val();
          var curSel = '';
  
          if (lens&gt;0) {
              curSel += '.lens_' + lens;
          }
          if (color&gt;0) {
              curSel += '.color_' + color;
          }
          if (style&gt;0) {
              curSel += '.style_' + style;
          }
          if (pstatus&gt;0) {
              curSel += '.status_' + pstatus;
          }
  
  
          if ((lens==0) &amp;&amp; (color==0) &amp;&amp; (style==0) &amp;&amp; (pstatus==0)) {
              curSel = '.prod';
              $('.product').prop('checked',true);
          }
  
  //      console.log('curSel: ' + curSel);
          $(curSel).show()
          $(curSel).prop('checked',true);
          $('#prod_count').text($('.prod:visible').length);
      });
  </code></pre>
  
  <p>After messing with things I've determined that if I don't .hide() anything then it all work as expected (other than not hiding things that need to be hidden) but if any <code>&lt;li&gt;</code>'s are hidden then even once their shown again checkboxes inside of them don't get included in the form submission even though other input fields do.</p>