html 5要求验证不在按钮标签中工作(在IE 10中) [英] html 5 required validation not working in button tag ( in IE 10)

查看:117
本文介绍了html 5要求验证不在按钮标签中工作(在IE 10中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

heyy ..



我使用的是文本框和按钮标签...当我使用html 5验证(必需)时..它不起作用。 ..在IE ..



这是我的代码: -





heyy..

I am using a textbox and a button tag ...when I use html 5 validation (required) ..it is not working ...in IE ..

here is my code :-


<asp:TextBox runat="server" ID="txtVehicleCode"   MaxLength="6" placeholder="Vehicle Code" required pattern=".*[^\s].*"></asp:TextBox>
       <button id="BodyContent_btnCmbCancel" type="submit" class="button cancel" runat="server"   onserverclick="Button1_Click">Cancel</button>









问题是当我点击按钮时,文本框未验证且事件发生...



我无法更改按钮标签(因为css)。有没有其他方式..?





Problem is when I clicked the button, textbox is not validate and the event occure...

I cannot change the button tag (because of css). Is there is any other way ..?

推荐答案

可能是IE在兼容模式下运行,在这种情况下它模拟IE7,它不支持HTML5验证。尝试使用其他浏览器(如Chrome或Firefox)查看是否遇到过相同的问题。如果结果是这种情况,您可以调整IE的兼容性视图设置(记下在兼容性视图中显示Intranet站点设置)
Could be that IE is running in compatibility mode in which case it emulates IE7 which does not support HTML5 validation. Try in another browser such as Chrome or Firefox to see if the same behaviour is experienced. If this turns out to be the case you can adjust the compatibility view settings for IE (Take note of the "Display intranet sites in Compatibility View" setting)


这篇关于html 5要求验证不在按钮标签中工作(在IE 10中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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