使用JavaScript禁用当前日期之前的日历日期 [英] Disable Calender Date before current date using javascript
本文介绍了使用JavaScript禁用当前日期之前的日历日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用javascript在ajax日历扩展器中禁用今天之前的日历日期?
How do i disable calender date before todays date in ajax calender extender using javascript?
推荐答案
确保添加以下js和css文件.
* jquery-1.4.1.min.js
* jquery.ui.core.js
* jquery.ui.datepicker.js
* jquery-ui-1.8.8.custom.css
现在粘贴以下代码:
Make sure you add the following js and css files.
* jquery-1.4.1.min.js
* jquery.ui.core.js
* jquery.ui.datepicker.js
* jquery-ui-1.8.8.custom.css
Now paste the following code:
<script type="text/javascript">
(function(){ var date = new Date(); var currentMonth = date.getMonth(); //这个月 var currentDate = date.getDate(); //当前的日期 var currentYear = date.getFullYear(); //今年
(function () { var date = new Date(); var currentMonth = date.getMonth(); // current month var currentDate = date.getDate(); // current date var currentYear = date.getFullYear(); //this year
(#% > ).datepicker({ changeMonth:true,//这将允许用户更改月份 changeYear:正确,//这将允许用户更改年份 minDate:新日期(currentYear,currentMonth,currentDate) }); }); < /script >
("#<%= tbxRequestDeliveryDate.ClientID %>").datepicker({ changeMonth: true, // this will allow users to chnage the month changeYear: true, // this will allow users to chnage the year minDate: new Date(currentYear, currentMonth, currentDate) }); }); </script>
<asp:textbox id="tbxRequestDeliveryDate" runat="server" cssclass="text" xmlns:asp="#unknown">
有关更多详细信息,请单击此处
For more detail click here
这篇关于使用JavaScript禁用当前日期之前的日历日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文