title: Could not get proper select value from jquery and pass it to date picker
body: <p>I am trying to get a select value using jquery, but when debugging. It only shows the first value == 1.</p>
  
  <p>Any idea why? Here's my code.</p>
  
  <pre><code>var clinic = $("#AppointmentClinicId").val();
  
   $("#datepicker").datepicker({
      dateFormat: "yy-mm-dd",
      minDate: 0,
      numberOfMonths: 3,
      showButtonPanel: true,
      beforeShowDay: function(date) {
          var day = date.getDay();
  
          console.log("clinic:" + clinic);
  
          if (clinic == 1) {
              return [day == 1, ""];
          }
  
          if (clinic == 2) {
              return [day == 2, ""];
          }
  
          if (clinic == 3) {
              return [day == 3, ""];
          }
  
          if (clinic == 4) {
              return [day == 4, ""];
          }
  
          if (clinic == 5) {
              return [day == 5, ""];
          }
  
          if (clinic == 6) {
              return [day == 6, ""];
          }
  
      }
   }).val()
  </code></pre>
  
  <p>Basically, I just want to return specific open days depending on the clinic. The thing is, I could not get the current value from #AppointmentClinicId.</p>
  
  <p>Help!</p>