title: getting multiple inputs with jquery
body: <p>So I am trying to create a jquery call(Still learning) to pull all the inputs I have on the page when they change, and send them to my php file for parsing, I want to use this to update my DB without a submit button and reloading the page over and over, below is what I currently have</p>
  
  <pre><code>    &lt;script&gt;
  var data = {};
      $(document).change(function() {
          var $name = $('.test').attr('name');
          var value = $('.test').attr('value');
          data[$name]=value;
  
          $.ajax({
              type: "POST",
              url: "some.php",
              data: data,
              success: function(response){
                  $("#legend").html(response);
              }
          });
      });
  &lt;/script&gt;
  &lt;div id="legend"&gt;&lt;/div&gt;
  &lt;form&gt;
  &lt;input type="text" name="hp" class="test"&gt;
  &lt;input type="text" name="mana" class="test" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>so what I am trying to do above, is use the variables I have set up for all my items with class, so that I don't have to create something to handle each input field, I know I could do it at the end with a submit, im just trying to do it as the person updates text, thanks for your time</p>
  
  <p>Here is a demo(because the php call works here):
  <a href="http://aardwolfbootcamp.com/lizza/hadtest.php" rel="nofollow">http://aardwolfbootcamp.com/lizza/hadtest.php</a></p>