Start and End Date in SharePoint forms using jQuery

How to use Start and End Date in SharePoint forms using jQuery

$(document).ready(function(){
    $("#txtFromDate").datepicker({
        numberOfMonths: 2,
         dateFormat: 'dd/mm/yy',
                    changeMonth: true,
                    changeYear: true,

        onSelect: function(selected) {
          $("#txtToDate").datepicker("option","minDate", selected)
        }
    });
    $("#txtToDate").datepicker({
        numberOfMonths: 2,
 dateFormat: 'dd/mm/yy',
                    changeMonth: true,
                    changeYear: true,

        onSelect: function(selected) {
           $("#txtFromDate").datepicker("option","maxDate", selected)
        }
    }); 
});


HTML:-

From: <input type="text" id="txtFromDate" />
To: <input type="text" id="txtToDate" />

Comments

Popular posts from this blog

How to Customize exported excel's cell background color in Datatables

Clear DataTable on button click

Upload multiple attachments to SharePoint List Item using REST API jQuery, along with People Picker Column