ASP.NET普通防爆pression验证器不工作在Internet Explorer 7 [英] ASP.NET Regular Expression Validator Not Working on Internet Explorer 7

查看:152
本文介绍了ASP.NET普通防爆pression验证器不工作在Internet Explorer 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的正前pression验证,以确保密码输入符合1上的情况下,1低的情况下,1号的要求,并允许1特殊字符:

I am using the following Regular Expression Validator to ensure the password enter meets the requirements of 1 upper case, 1 lower case, 1 number, and 1 allowed special character:

    <asp:RegularExpressionValidator ID="rev_txtNewPassword" runat="server" Display="Dynamic"
    ErrorMessage=" Password does not meet requirements" ControlToValidate="txtNewPassword" ValidationGroup="password"
    ValidationExpression="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[!@#$%^&*]).{8,16}$"></asp:RegularExpressionValidator>

这工作在火狐,Chrome,Safari浏览器,Internet Explorer 8和9,它只是没有在Internet Explorer 7的工作不管是什么输入到密码框,它说,它不符合要求。这是一个自定义的SharePoint 2010 Web部件的一部分。

This works in FireFox, Chrome, Safari, Internet Explorer 8 and 9. It just doesn't work on Internet Explorer 7. No matter what is entered into the password box, it says it doesn't meet the requirements. This is part of a custom SharePoint 2010 web part.

任何想法,为什么除权pression验证不仅是在IE7的工作?

Any ideas why the expression validator isn't working only on IE7?

感谢

推荐答案

由于OP的要求,我把这里的解决方案,从而解决了大家可以看到这个问题。的问题是由 IE的正则表达式先行错误的引起与原溶液通过由艾伦·摩尔。该解决方案可以在这里找到:

As the OP requests, I put the solution here so everybody can view this question as solved. The problem is caused by the IE regex lookahead bug and the original solution is made by Alan Moore. The solution can be found here:

<一个href=\"http://stackoverflow.com/questions/3241076/regular-ex$p$pssion-fails-in-ie-but-works-in-chrome-and-firefox\">Solution

这篇关于ASP.NET普通防爆pression验证器不工作在Internet Explorer 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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