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.
- <asp:Content ID="SampleContent" ContentPlaceHolderID="SampleCPH" runat="server">
- <div>
- <label>Date Of Birth</label>
- <asp:TextBox ID="txtDOB" runat="server" />
- </div>
- <script>
- $(function () {
- $("[id$=txtDOB]").datepicker();
- $("[id$=txtDOB]").datepicker({ dateFormat: 'ISO 8601 - yy-mm-dd' }); // not working
- });
- // not working
- $("#format").change(function () { $("[id$=txtDOB]").datepicker('ISO 8601 - yy-mm-dd', "dateFormat", $(this).val()); });
- </script>
- </asp:Content>
I tried both ways but not working.
- $("[id$=txtDOB]").datepicker({ dateFormat: 'ISO 8601 - yy-mm-dd' });
- $("#format").change(function () { $("[id$=txtDOB]").datepicker('ISO 8601 - yy-mm-dd', "dateFormat", $(this).val()); });