JQuery UI Datepicker go to date url

Does anyone know if the jQuery UI Datepicker can be used and when clicking on the date, set document.location to that date appended to the pre-configured url?

So, if I clicked on one of the dates, this could direct me to:

http://www.mysite.com?date=2009-10-25

I just need to use this as a quick way to quickly navigate to my website's calendar.

Ideas?

+2


source to share


3 answers


Just give it a function onSelect

to call.



+2


source


I am assuming you download the datapicker from Jqueryui.com with examples so that you can select a date from the calendar with:

$('#datepicker').val()

      



so insert it into a function onclick()

or onchane()

function

0


source


I made a small example, it works for me just by changing the date format :)

$().ready(function(){  
    $('#datepicker').click(function(){
        window.location.replace("http://www.mysite.com/?date=" + $('#datepicker').val());
    });
});

      

0


source







All Articles