title: calling jquery ajax() with drop down menu?
body: <p>im working a domain check script it works fine when i call ajax on keyup but by default the dropdown has the .com  what if the user chooses a domain that is already taken, how can i get this script to do another check when the users switch from .com to .net or .org?</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;script type='text/JavaScript'&gt;
  
  $(document).ready(function () {
  
      var validateUsername = $('#validateUsername');
      $('#domain').keyup(function () {
          var domain = $('#domain').val();
          var tld = $('#tld').val();
          if (this.value != this.lastValue) {
              if (this.timer) clearTimeout(this.timer);
              validateUsername.removeClass('error').html('checking...');
              this.timer = setTimeout(function () {
                  $.ajax({
                      url: 'DomainCheck.php',
                      data: 'domain=' + domain + '&amp;tld=' + tld,
                      dataType: 'json',
                      type: 'post',
                      success: function (j) {
                          validateUsername.html(j.msg);
                      }
                  });
              }, 3500);
              this.lastValue = this.value;
         }
      });
  });
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="" method="post"&gt;
              &lt;fieldset&gt; 
                  &lt;legend&gt;choose your domain&lt;/legend&gt; 
                  &lt;div&gt; 
                    &lt;span class="httpFont"&gt;http://www.&lt;/span&gt;
                    &lt;input type="text" name="domain" value="" id="domain" autocomplete="off" /&gt;  
                    &lt;select id="tld" name="tld"&gt;
                       &lt;option selected="selected" value="com"&gt;.com&lt;/option&gt;
                       &lt;option value="net"&gt;.net&lt;/option&gt;
                       &lt;option value="org"&gt;.org&lt;/option&gt;
                    &lt;/select&gt;&amp;nbsp;&lt;span id="validateUsername"&gt;&lt;/span&gt;
                  &lt;/div&gt; 
             &lt;/fieldset&gt; 
             &lt;input type="hidden" name="action" value="register" /&gt; 
             &lt;div class="submit"&gt;
             &lt;input type="submit" alt="Submit button"&gt; 
      &lt;/form&gt; 
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>