日历扩展程序的JavaScript验证 [英] JavaScript validation for calendar extender

查看:57
本文介绍了日历扩展程序的JavaScript验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ajax日历扩展器作为日期....

我有两个文本框,当我单击文本框时,会弹出ajax日历,而当我单击日期时,它会消失.

我的问题是,如果我在第一个文本框中选择03/02/2011,则用户将无法选择2011年3月2日之前的日期....

请帮助我使用JavaScript进行操作......

I am using ajax calendar extender for date....

I have two textbox''s, when i clicked on the textbox, ajax calendar will pop up and when i clicked a date,it will dissappear.

My question is, if i am selecting 03/02/2011 in the first textbox,the user wont be able to select a date before 03/02/2011....

please help me to do it using JavaScript.........

推荐答案

function DateCheck()
{
  var StartDate= document.getElementById('txtStartDate').value;
  var EndDate= document.getElementById('txtEndDate').value;
  var eDate = new Date(EndDate);
  var sDate = new Date(StartDate);
  if(StartDate!= '' && StartDate!= '' && sDate> eDate)
    {
    alert("Please ensure that the End Date is greater than or equal to the Start Date.");
    return false;
    }
}



您可以将比较验证器用于日期验证.

谢谢,
Imdadhusen
Hi,
You can use Compare Validator for From and To date validation.

Thanks,
Imdadhusen


这篇关于日历扩展程序的JavaScript验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆