title: How to submit checkbox through jquery ajax?
body: <p>I have difficulty submitting this form:</p>
  
  <pre><code>&lt;form action="/someurl" method="post"&gt;
      &lt;input type="hidden" name="token" value="7mLw36HxPTlt4gapxLUKWOpe1GsqA0I5"&gt; 
      &lt;input type="checkbox" class="mychoice" name="name" value="apple"&gt; Apple
      &lt;input type="checkbox" class="mychoice" name="name" value="orange"&gt; Orange      
      &lt;input type="checkbox" class="mychoice" name="name" value="pear"&gt; Pear
    &lt;/form&gt;
  </code></pre>
  
  <p>And the jquery bit:</p>
  
  <pre><code>$('.mychoice').click( function() {
      $.ajax({
          url: '/someurl',
          type: 'post',
          dataType: 'json',
          success: function(data) {
                   //  ... do something with the data...
                   }
      });
  });
  </code></pre>
  
  <p>But nothing happens when I click a checkbox. How can I fix this? </p>
  
  <p><strong>UPDATE:</strong> It may worth mentioning that the form is located at a bootstrap modal. </p>