title: Jquery Ajax Post array of input data
body: <p>I am writing a thing to compare two passwords with each other, if they match the script sends out a response that says it is the same.</p>
  
  <p>I currently have got this code:</p>
  
  <pre><code>$("#repeatPw").keyup(function(){
      jQuery.ajax({
          url: "System/Javascript/Functions/checkPasswords.php",
          data: "'password1'='" + $("#Password").val() + "', 'password2'='" + $("#repeatPw").val() + "'",
          type: "POST",
          success: function(data) {
              $("#passwordMatch").html(data);
          },
          error: function(data) {}
      });
  });
  </code></pre>
  
  <p>Now my problem is that i cant get this password1 and password2 in a proper array i can explode in the checkPasswords.php, this posts this:</p>
  
  <blockquote>
    <p>Array ( ['password1'] => 'fasfasdfasSD2', 'password2'='asdasdasd' )</p>
  </blockquote>
  
  <p>But this is not a proper array as it only puts password1 in proper array format, how would i go about making password2 in this format too?</p>
  
  <p>Thank you all in advance!</p>