Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am migrating my application from IE 9 to IE 11 with compatibility edge mode.
the asp custom validator and required field validator is not working in IE 11, but page.isValid() always returns true. but it works fine in IE 9.

What I have tried:

Sample Codes:
ASP.NET
<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:

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;
		}



C#
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;
		}
Posted
Comments
Richard Deeming 12-May-16 10:42am    
Check for script errors in the developer tools console.
Member 12439857 12-May-16 23:38pm    
Its not shows any script errors if i change the mode to IE 5 its working fine
Sergey Alexandrovich Kryukov 12-May-16 11:01am    
"I am migrating my application from IE 9 to IE 11..." There is no such thing. You should not do development for IE, no matter what version. You need to develop for a Web browser. You lost the battle from the very beginning, when you decided to develop anything for IE 8, or what it was then.
—SA
Member 12439857 12-May-16 12:31pm    
Sorry we are not migrating it, we want it to work it in IE 11.We just updated the doc type and meta tags
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=8, IE=9, IE=10, IE=11" />
</head>
Sergey Alexandrovich Kryukov 12-May-16 12:49pm    
Sorry, "migrating" is your word... I understand that correct IE 11 operation might be your requirement, I'm just saying that targeting IE is a mistake. I would move from the standards and check compatibility charts per feature you are trying to use.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900