如何将asp.net startdate enddate验证添加到< asp:textbox>控制 [英] How to add asp.net startdate enddate validation to <asp:textbox> control
问题描述
如何将asp.net startdate enddate验证添加到< asp:textbox>控制(jquery验证)。
------------------------------------ ------------------------------------------------ <无线电通信/>
即时通讯使用以下链接先生
-----------------------
http://www.aspsnippets。 com / Articles / jQuery-DatePicker-Start-Date-should-less-than-End-date-validation.aspx [ ^ ]
= ================================================== ===========================
我的表格不支持
日期拣货员战争。
--------------------------------------------
这是我的代码先生
-------------------
How to add asp.net startdate enddate validation to <asp:textbox> control(jquery validation).
------------------------------------------------------------------------------------
im using below link sir
-----------------------
http://www.aspsnippets.com/Articles/jQuery-DatePicker-Start-Date-should-be-less-than-End-date-validation.aspx[^]
==============================================================================
date pickker war not supported to my form.
--------------------------------------------
this is my code sir
-------------------
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"
type="text/javascript"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"
rel="Stylesheet"type="text/css"/>
<script type="text/javascript">
var t = "";
$(function () {
$("#txtStartDate").datepicker({
numberOfMonths: 1,
onSelect: function (selected) {
var dt = new Date(selected);
dt.setDate(dt.getDate() + 1);
$("#txtLastDate").datepicker("option", "minDate", dt);
}
});
$("#txtLastDate").datepicker({
numberOfMonths: 1,
onSelect: function (selected) {
var dt = new Date(selected);
dt.setDate(dt.getDate() - 1);
$("#txtStartDate").datepicker("option", "maxDate", dt);
}
});
});
</script>
-------------------------------------------------------------------
<asp:TextBox ID="txtStartDate" runat="server">
<asp:TextBox ID="txtLastDate" runat="server">
推荐答案
( function (){
( #txtStartDate)。datepicker({
numberOfMonths: 1 ,
onSelect: function (已选择){
< span class =code-keyword> var dt = new 日期(已选中);
dt.setDate(dt.getDate()+ 1 );
("#txtStartDate").datepicker({ numberOfMonths: 1, onSelect: function (selected) { var dt = new Date(selected); dt.setDate(dt.getDate() + 1);
( #txtLastDate)。datepicker( option, minDate,dt);
}
});
("#txtLastDate").datepicker("option", "minDate", dt); } });
这篇关于如何将asp.net startdate enddate验证添加到< asp:textbox>控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!