jQuery > on checkbox change run code
<p>I have rows of "To Do" on a checklist, each row has a "Completed" checkbox.  Upon clicking the box with the mouse, the following code runs and correctly posts the information (updates the database to track that the task has been completed):</p>

<pre><code>   $(function ()
 {
     $('[id*="howto_step_complete"]').mousedown(function ()
     {
         var id = $(this).attr('id');
         var howto_used_id = id.substr(id.length - 2);

         var howto_step_minutes = $('#howto_step_minutes' + howto_used_id).val();

         if (!$(this).is(':checked'))
         {
             var checked = true;
         }
         else
         {
             var checked = false;
         }
         var value = $('#howto_used_id').val();
         if (howto_step_minutes != '')
         {
             $.post("updateChecklist.php",
             {
                 howto_used_id: howto_used_id,
                 howto_step_complete: checked,
                 howto_step_minutes: howto_step_minutes
             },

             function (data)
             {
                 var obj = jQuery.parseJSON(data);
                 var howto_used_id_returned = obj.howto_used_id;
                 var howto_step_complete = obj.howto_step_complete;
                 alert(howto_step_complete);
             });
             $(this).trigger("change");
         }
         else
         {
             alert('Minutes must be filled out before checking complete');
         }
     });

 });
</code></pre>

<p>The problem is, if a person uses tabs to move around the form and then uses the spacebar to check the box instead, this isn't triggered, as it's using mousedown.  I tried changing this to <code>change()</code> instead but then my alert box keeps coming up over and over again with "false".</p>

<p>It should be true since I've just checked the box and I don't understand why it continually comes up.  </p>

<p>What can I use instead of <code>mousedown()</code> to get this code to post properly?</p>
