Using AJAX to make a call to the database
<p>What I would like to do here is to use these functions but when the user clicks the element, I need to make a call to the database with the id that was clicked.</p>

<p>I have about 6 of these buttons that I would like to implement so how would I utilize one function to do this? I'm thinking to use one function that would take an id param</p>

<pre><code>function toggle(id){
  //I'm lost from here. :)
}
</code></pre>

<p>Also, do I need an AJAX call on the enable and disable  toggles or can I use one call?</p>

<p>I'm not sure how any of this would be done. Can someone lend a hand?</p>

<pre><code>  $(".enable").click(function(){
    var parent = $(this).parents('.switch');
    $('.disable',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', true);
  });

  $(".disable").click(function(){
    var parent = $(this).parents('.switch');
    $('.enable',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', false);
  });
</code></pre>
