当我从我的代码中删除日期格式时,它工作正常。但是当我添加日期格式时,从日期和日期的检查不起作用。我的验证逻辑无法确定日期和日期。
A
<script type="text/javascript">
$(function () {
$.datepicker.setDefaults({
**dateFormat:'dd/mm/yy',**
showOn: "both",
buttonImageOnly: true,
buttonImage: 'images/calender.jpg',
buttonText: "Calendar",
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
});
var dates = $('#from, #top').datepicker({
onSelect: function (selectedDate) {
var option = this.id == "from" ? "minDate" : "maxDate";
dates.not(this).datepicker("option", option, new Date(selectedDate));
}
});
});
</script>
<label for="from">
From</label>
<asp:TextBox ID="from" runat="server"></asp:TextBox>
<label for="to">
To</label>
<asp:TextBox ID="to" runat="server"></asp:TextBox>