K
KA Kueh
Dear all,
I am having problems with "document.getElementsById " in IE7 where it will
throw an error. The same piece of code works perfectly in IE 6 and Firefox
2. Sample code as shown below. What can be done? Thanks.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestForm1.aspx.cs"
Inherits="TestForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function test()
{
document.getElementsById('RadioButtonXX').disabled=false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
</asp:ScriptManager>
<div>
<asp:button ID="btnDelete" runat="server" onClientClick="return confirm('Are
you sure you want to delete this mailbox?')" Text="Delete" />
<asp:RadioButtonList ID="RadioButtonList1" runat="server" >
<asp:ListItem>Apple</asp:ListItem>
<asp:ListItem>Orange</asp:ListItem>
</asp:RadioButtonList>
<asp:CustomValidator ID="CustomValidator1" runat="server"
ClientValidationFunction="test"
ControlToValidate="RadioButtonList1">
</asp:CustomValidator>
<aspropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="One" Value="1"></asp:ListItem>
<asp:ListItem Text="Two" Value="2"></asp:ListItem>
</aspropDownList>
<asp:RadioButtonList ID="RadioButtonXX" Enabled="true" runat="server" >
<asp:ListItem>Car</asp:ListItem>
<asp:ListItem>Lorry</asp:ListItem>
</asp:RadioButtonList >
</div>
</form>
</body>
</html>
I am having problems with "document.getElementsById " in IE7 where it will
throw an error. The same piece of code works perfectly in IE 6 and Firefox
2. Sample code as shown below. What can be done? Thanks.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestForm1.aspx.cs"
Inherits="TestForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function test()
{
document.getElementsById('RadioButtonXX').disabled=false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
</asp:ScriptManager>
<div>
<asp:button ID="btnDelete" runat="server" onClientClick="return confirm('Are
you sure you want to delete this mailbox?')" Text="Delete" />
<asp:RadioButtonList ID="RadioButtonList1" runat="server" >
<asp:ListItem>Apple</asp:ListItem>
<asp:ListItem>Orange</asp:ListItem>
</asp:RadioButtonList>
<asp:CustomValidator ID="CustomValidator1" runat="server"
ClientValidationFunction="test"
ControlToValidate="RadioButtonList1">
</asp:CustomValidator>
<aspropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="One" Value="1"></asp:ListItem>
<asp:ListItem Text="Two" Value="2"></asp:ListItem>
</aspropDownList>
<asp:RadioButtonList ID="RadioButtonXX" Enabled="true" runat="server" >
<asp:ListItem>Car</asp:ListItem>
<asp:ListItem>Lorry</asp:ListItem>
</asp:RadioButtonList >
</div>
</form>
</body>
</html>