Datepicker disappear on click

Datepicker disappear on click

Hi all,

I'm using a datepicker that I want to be always shown on my page.  On selecting a date, I want the users browser to immediately load a new page based on the selected date.

I have everything working fine, other than when the user selects a date, the datepicker disappears while the new page is loading, but I want it to just stay visible.

My xhtml:

  
  1.  <div id="additional_whats-on-when" class="section">
  2.     <div class="headerOne">
  3.          <h2>What's on when</h2>
  4.      </div>
  5.     <div id="whats-on-when-calendar-box">
  6.      </div>
  7. </div> 
My jquery code:

   
  1. $().ready(function() {
        $("#whats-on-when-calendar-box").datepicker({
            firstDay:1,
    minDate:"-0d",
    maxDate:"+1y",
    dateFormat:'yy/mm/dd',
    onSelect:function(dateText,inst) { window.location.href = "/whatson/when/"+dateText+"/"},
        });
    });
Interestingly, if I change my onSelect function to:
   
  1.  onSelect:function(dateText,inst) { alert("Test"); return true; }
My datepicker stays visible when the alert box shows and once I click ok and the alert box disappears.

Many thanks for any help.  
Greg.