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