title: datepicker and focusout in textbox
body: <p>i have a datepicker on a textbox and in the same time i'm using a function that checks if the user has entered the right date and time format using javascript.</p>
  
  <p>The problem i am facing is that whenever i have the mouse selected on the textbox the datepicker shows as it should but if i want to select a date from the datepicker the focusout() function is executed and i must re-click again on the date from the datepicker to be selected.</p>
  
  <p>here is my code:</p>
  
  <pre><code>     $('#StartDateTime').datepicker({
          /* here is only to stay focusin() on the textbox after selecting date */
          constrainInput: false,
          fixFocusIE: false,
          onSelect: function (dateText, inst) {
              this.fixFocusIE = true;
              $(this).change().focus();
          },
          onClose: function (dateText, inst) {
              this.fixFocusIE = true;
              this.focus();
          },
          beforeShow: function (input, inst) {
              var result = $.browser.msie ? !this.fixFocusIE : true;
              this.fixFocusIE = false;
              return result;
          }
      }).click(function () { $(this).focus() });
  
      $("#StartDateTime").focusout(function () {
          if (sDTValid() == false) {
              alert("Please enter Date (Day/Month/Year) &amp; Time (HH:MM AM or PM)");
          }
      });
  
      function sDTValid() {
      /* this is the function of date and time format validation*/
          var sDT = document.getElementById('StartDateTime').value;
          if (sDT.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4}) (\d{1,2}):(\d{2}) (.*)$/)) {
              return true;
          }
          else {
              return false;
          }
      }
  </code></pre>