title: AJAX checkboxes with Jquery and PHP
body: <p>I have two rows of check-boxes. When a user clicks on any individual check-box (in a certain row) I want to add a number to my sum in PHP. If he deselects an individual check-box I want to subtract from the total in real time without page refresh. <strong>My question what goes in the data field on my AJAX call?</strong></p>
  
  <p><em><strong>and is this the correct way to do it ?</em></strong></p>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;input type="checkbox" name="standard_form[]" value="A" onclick="processForm()"&gt;
  &lt;input type="checkbox" name="premium_form[]" value="B" onclick="processForm()"&gt;
  </code></pre>
  
  <h2>JQUERY</h2>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function processForm() { 
          $.ajax( {
              type: 'POST',
              url: 'submit_form.php',
              data: '',
  
              success: function(data) {
                  $('#message').html(data);
              }
          } );
  }
  &lt;/script&gt;
  </code></pre>
  
  <h2>PHP</h2>
  
  <pre><code>    if(IsChecked('standard_form','A'))
      {
        $price += IsChecked('standard_form','A') ? 10 : 0;
      }
     return $price ; 
  </code></pre>
  
  <hr>