Jquery中的日期验证 [英] Date validation in Jquery

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

问题描述

请在jquery中帮助开始日期和结束日期验证。



我使用了以下代码但是没有工作 -



  var  fDate =  new 日期( FD); 
var tDate = new 日期(tD);
if (fDate > tDate){
alert( 到目前为止应该大于From Date
return false ;







请帮忙。



感谢....

解决方案

查看此jsfiddle示例



http://jsfiddle.net/jinglesthula/dESz2/ [ ^ ]



这个例子很好,它有日期时间选择器,你从字段中选择后不允许选择返回日期



HTTP:// jsfiddle.net/jquerybyexample/CkfDP/ [ ^ ]

Please help for start date and end date validate in jquery.

I have used the below code but is not working-

var fDate = new Date(fD);
                   var tDate = new Date(tD);
                   if (fDate > tDate) {
                       alert("To date should be greater than From Date")
                       return false;




Please help for same.

Thanking ....

解决方案

see this jsfiddle example

http://jsfiddle.net/jinglesthula/dESz2/[^]

This example is a good one, it has date time picker and you will not allow to select back date on to field after you selected from field

http://jsfiddle.net/jquerybyexample/CkfDP/[^]


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

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