title: passing multiple variables from HTML to Ajax than posting multiple variables from Ajax to php
body: <p>I have the following form, which has 3 values. Class, Section and School. The school is selected from a drop down list that is brought from database.
  (for simplicity I have not included those details here.. ) (in reality my code works)</p>
  
  <pre><code>&lt;form id="form1" name="form1" method="post" action=""&gt;                   
  &lt;input type="hidden" name="class" value="someclass"&gt;
  &lt;input type="hidden" name="section" value="somesection"&gt;
  &lt;select name="school" id="school"&gt;          
  &lt;option&gt; "school 1"  &lt;/option&gt;  
  &lt;option&gt; "school 2"  &lt;/option&gt;
  &lt;option&gt; "school 3"  &lt;/option&gt;
  &lt;option&gt; "school 4"  &lt;/option&gt;
  &lt;option&gt; "school 5"  &lt;/option&gt;                  
  &lt;/select&gt;       
  &lt;/form&gt;
  </code></pre>
  
  <p>I am doing this for the Ajax, and for only 1 variable (the item from list) was working fine, however after adding the class and the section values, I was not able to get those 3 into the Ajax, so that I can post them into the PHP. (syntax might be wrong as this is just copy paste some of the portion of the code.)</p>
  
  <pre><code>$("#school").change(function ()
  {
   resetValues();
  
  
      var school = { school:$(this).attr('value') };
      var class= { class:$(this).attr('value')    };
      var section= { section:$(this).attr('value')};
  
  jQuery.ajax({
                    url: 'getTheData.php',
                    type: "POST",
                    dataType: "xml",
                    data:school&amp;class&amp;section,
                    async: false,
                    success: schoolOnSuccess
              });
  </code></pre>
  
  <p>And naturally I am using _POST to get the values on the getTheData.php the traditional way.</p>
  
  <p>Where am I going wrong ? </p>