title: Jquery .Change Function with If statement
body: <p>I have another questions, as I am still new to javascript and jQuery. I am using Ajax to update a hidden field with a value. Ajax is sending back the correct Billing Domain (The state the service is offered) upon the selection of an office (which can have more than one office in a state). </p>
  
  <p>Here is the jQuery that I am struggling with. </p>
  
  <p>I am using this portion to make sure that the BillingDomainID1 Class is hidden or shown upon page load, Prior to a dropdown selection. This works well.</p>
  
  <pre><code>if($("#BillingDomainID").val() != 1){
          $(".BillingDomainID1").hide();
      } else {
          $(".BillingDomainID1").show();   
  };
  </code></pre>
  
  <p>This part is where I am having the trouble. The getOfficeInfo part is flawless, as it does post the BillingDomainID value as it expected, but the If statement below requires that I click the OfficeID dropdown value twice before the If statement works. 
  For the fun of it, I added an alert('hi') between the getOfficeInfo and the if statement and it made the if statement work. It almost seemed like the getOfficeInfo portion did not update the value fast enough for the if statement to work. What can I do to solve this?</p>
  
  <pre><code>    $("#OfficeID").change(function() {  
  
          getOfficeInfo($("#OfficeID").val(),$("#BillingDomainID")); 
  
          if ($('#BillingDomainID').val() != 1) {
              $('.BillingDomainID1').hide();
              return;
          } else {
              $('.BillingDomainID1').show()
          }
  
      });
  </code></pre>
  
  <p>Thank you all so much for your help!</p>