title: How to pass two variables on keyup?
body: <p>Stuck on this one. I would like to pass 2 of my form inputs on the keyup of "username".  I would like to send "username" and "location" inputs to my php. Can this be done?  Tried a few things but can't figure it out.</p>
  
  <p>Note: I would like to pass both when "username"is being typed.</p>
  
  <p>Form:</p>
  
  <pre><code>&lt;fieldset&gt;
  &lt;input name="location" type="text" id="location" maxlength="15"&gt;
  &lt;label for="username"&gt;Enter Username :                                                                 
  &lt;input name="username" type="text" id="username" maxlength="15"&gt;                            
  &lt;span id="user-result"&gt;&lt;/span&gt;                                      
  &lt;/label&gt;                                                                    
  &lt;/div&gt;                                                              
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>script:</p>
  
  <pre><code>$(document).ready(function() {
      $("#username").keyup(function (e) {
  
          //removes spaces from username
          //$(this).val($(this).val().replace(/\s/g, ''));
          var username = $(this).val();
          if(username.length &lt; 4){$("#user-result").html('');return;}
  
          if(username.length &gt;= 4){
              $("#user-result").html('&lt;img src="../images/ajax-loader.gif" /&gt;');
              $.post('check.php', {'username':username}, function(data) {
                $("#user-result").html(data);
              });
          }
      }); 
  });
  </code></pre>