Jquery UI datepicker, onclick of a date , get the date and pass to URL

前端 未结 1 1196
鱼传尺愫
鱼传尺愫 2020-12-29 12:24

I have a jquery UI datepicker calendar in an event page(sharepoint page).

$(\'#datepicker\').datepicker();

I need to get the date once use

相关标签:
1条回答
  • 2020-12-29 13:13

    try

    $('#datepicker').datepicker({
        onSelect: function(dateText, inst) { 
            window.location = 'http://mysite/events/Pages/default.aspx?dt=' + dateText;
        }
    });
    

    uses the onSelect event (documented here)

    Allows you to define your own event when the datepicker is selected. The function receives the selected date as text and the datepicker instance as parameters. this refers to the associated input field.

    0 讨论(0)
提交回复
热议问题