日期和正则表达式中的Jquery验证 [英] Jquery Validation in Dates and regular expression
本文介绍了日期和正则表达式中的Jquery验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
1)我必须比较两种格式的日期:在jQuery中,mm-dd-yyyy格式与mm/dd/yyyy格式.
和
2)
Hi,
1)I Have To compare Dates Of Two Formats: mm-dd-yyyy format to mm/dd/yyyy Format , in Jquery.
and
2)
function validate_date(date) {
var pattern = new RegExp(/\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/);
return pattern.test(date);
}
我使用的上述功能允许使用mm/dd/yyy格式.它允许月份> 12和日期> 31,我想限制一个
请建议如何在jquery中进行验证.
请提供以上两个问题的答案.
the above function i use it allows mm/dd/yyy format. it allows month>12 and date>31 i want to restrict that one
please advice how to validate in jquery.
please give answers for above two questions.
推荐答案
您好,对于jQuery验证,请检查此插件.
http://plugins.jquery.com/content/better-date-validation [ ^ ]
Hi, for jQuery validation, check this plugin.
http://plugins.jquery.com/content/better-date-validation[^]
这篇关于日期和正则表达式中的Jquery验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文