Asp自定义验证器在IE-11中不起作用
Asp custom validator is not working in IE-11
我正在使用兼容边缘模式将我的应用程序从IE 9迁移到IE 11。asp自定义验证器和必需字段验证器在IE 11中不起作用,但page.isValidat()始终返回true。但它在IE 9中运行良好。
样本代码:
<asp:DropDownList ID="cboType" onChange="fnInvalid(this,'hidTypeValid');getSelectedValue('cboType','hidliab');changeOptions(document.forms[0].hidliab,document.forms[0].cmbLiability,document.forms[0].hid_liab,document.forms[0].HIDSERLIAB);" runat="server" name="cbotype"AutoPostBack="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="VreqvalidateType" runat="server" Display="None" ControlToValidate="cboType" ErrorMessage="-Case Type should not be blank" InitialValue="Choose"></asp:RequiredFieldValidator>
<asp:CustomValidator ClientValidationFunction="fnInvalidSelection" ID="VcustTypeValid"
runat="server" Display="None" ControlToValidate="cboType" ErrorMessage="-Case Type should have valid selection."></asp:CustomValidator>
<asp:CustomValidator ClientValidationFunction="fnTypeFileClass" ID="VcusTypeFile" runat="server" Display="None" ControlToValidate="cboType" ErrorMessage="- Case File Classification should not be empty."></asp:CustomValidator>
<asp:CustomValidator Enabled="false"ClientValidationFunction="fnTypeCaseHandler"ID="VcusTypeCaseHandler" runat="server" Display="None" ControlToValidate="cboType"ErrorMessage="- Case Handler 1 should not be empty."></asp:CustomValidator>
Javascript:
<pre lang="C#">function fnTypeCaseHandler(sender,args)
{
var s = args.Value;
args.IsValid = true;
if (s!="K")
{
var handler1= document.frmCaseDetails.cmbHandler1.value;
if (handler1 =="Choose")
{
args.IsValid = false;
}
}
return args.IsValid;
}
function fnTypeFileClass(sender,args)
{
var s = args.Value;
args.IsValid = true;
if (s!="K")
{
var file = document.frmCaseDetails.cmbFileClass.value;
if (file =="Choose")
{
args.IsValid = false;
}
}
return args.IsValid;
}
这是因为IE-11问题,我们在页面的标题部分制作了与IE-11兼容的<meta>
标签,它运行良好。
相关文章:
- window.opener.document在ie中不起作用
- 为什么Telerik cdn在IE中不起作用
- JQuery脚本在IE中不起作用
- 谷歌分析在IE中不起作用
- HTML表单在IE中不起作用
- Javascript style.background在IE中不起作用
- ng-单击在IE中不起作用的选项选择Angularjs
- Image Map 在 FF 和 IE 中不起作用(使用 onclick javascript)
- JavaScript在IE中不起作用
- 使用JavaScript自动更改键盘语言,没有IE就不起作用
- 将“”附加到在 IE 中不起作用的字符串
- window.dispatchEvent 在 Firefox、Safari 或 IE 中不起作用
- 动态文本大小JavaScript在IE中不起作用
- 对javascript中函数的调用在IE中不起作用
- SVG元素的动态动画在IE中不起作用
- top.window.location在IE中不起作用
- SVG作为标记的图标在IE中不起作用
- Javascript下载在Firefox和IE中不起作用
- Javascript:保存和恢复样式状态在IE中不起作用
- 函数 Window.focus 在 IE 中不起作用(8, 9, 10, 11)