用于日期验证的jQuery在IE9中不起作用 [英] Jquery for date validation not working in IE9

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

问题描述

在IE9中,我的jquery无法正常工作.其实问题是当我在文本框中输入不完整的日期时,它应该给出一个错误的弹出窗口,显示无效的日期,但是在IE9中,jQuery默认情况下使用今天的日期,并在不给出错误弹出窗口的情况下聚焦到下一个文本框.

请帮助我解决这个问题..谢谢您.

In IE9 my jquery is not working properly. Actually the problem is when i enter the incomplete date in the textbox it should give an error popup showing invalid date ,but in IE9 the jquery takes the todays date by default and focuses to the next textbox without giving an error popup.

Please help me to resolve this question.. Thanks in advanced.

推荐答案

防止这种情况的一种基本解决方案是使用 Regex 来处理解析之前进行验证.

您可能需要应用这种正则表达式,有关更多详细信息,请参见链接:

http://www.regular-expressions.info/dates.html [
One basic solution to prevent from this is using Regex to handle the validation before parsing it.

You may need to apply this kind of Regex, see in the link for additional details:

http://www.regular-expressions.info/dates.html[^]


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

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