date format and restricting date range

date format and restricting date range

In my asp.net page, I have used the datepicker. I tried to change the date format and restrict the date range but it is not working. Only the datepicker is working currently. 
  1. <asp:Content ID="SampleContent" ContentPlaceHolderID="SampleCPH" runat="server">

  2. <div>
  3. <label>Date Of Birth</label>
  4. <asp:TextBox ID="txtDOB" runat="server" />
  5. </div>


  6. <script>
  7. $(function () {
  8. $("[id$=txtDOB]").datepicker();

  9. $("[id$=txtDOB]").datepicker({ dateFormat: 'ISO 8601 - yy-mm-dd' });  // not working
  10. });
  11. // not working
  12. $("#format").change(function () { $("[id$=txtDOB]").datepicker('ISO 8601 - yy-mm-dd', "dateFormat", $(this).val()); });
  13. </script>
  14. </asp:Content>

I tried both ways but not working.

  1. $("[id$=txtDOB]").datepicker({ dateFormat: 'ISO 8601 - yy-mm-dd' });
  2. $("#format").change(function () { $("[id$=txtDOB]").datepicker('ISO 8601 - yy-mm-dd', "dateFormat", $(this).val()); });