提问人:Fadhil Dzulfiqar 提问时间:12/8/2022 最后编辑:Manish BavireddyFadhil Dzulfiqar 更新时间:12/9/2022 访问量:96
获取值 DateTime Javascript “if 语句” on asp.net
Get Value DateTime Javascript "if statement" on asp.net
问:
我正在尝试调试代码,对于 ExpiredDate 和 EffectiveDate,值为 null。当用户选择日期时如何获得价值?
法典
function checkDate() {
var ExpiredDate = document.getElementById("<%=dtExpiredDate.ClientID %>");
var EffectiveDate = document.getElementById("<%=dtEffectiveDate.ClientID %>");
var ddEmpStatus = document.getElementById('<%=ddEmpStatus.ClientID %>');
var ddEmpStatusVal = ddEmpStatus.value;
var ddEmpType = "<%=ddEmpType.ClientID %>";
var ddvalue = $("#" + ddEmpType).val();
if (ddEmpStatusVal == "Expatriate") {
if (ExpiredDate < EffectiveDate) {
alert("Expire Date is before Effective Date!");
return false;
}
}
if (ddEmpStatusVal == "National") {
if (ddvalue != "Employee" && ddvalue != "Direct Contract") {
if (ExpiredDate < EffectiveDate) {
alert("Expire Date is before Effective Date!");
return false;
}
}
}
}
答: 暂无答案
评论