I have a project that was written in asp.net 1.1 towards IE 6 and worked with IE 7 but we upgraded a new web server and it has IE 8 and now when we try to build the project it gives us all these javascript errors it never did before, this first example is
just on page load to get teh cordinates of scrolling but it gives the error. Is there something we have to do for IE8.0 to accept all this, we even tried in compatability mode and it gave the same errors. As I said we built the project and browsed and got
the error but on a IE 7 or Ie 6 we do not get the error
I found out that I needed to replace (.frm) with (document.getElementById(Control) for that page and it worked and got rid of the error, but I am having the same propeblme iwth my controls on another page but its the actual form controls, my checkboxes,
textboxes so on, I should be able to replace the .frm with above but it keeps telling me another error.
Object doesnt support this property or method 'document.getElementById(....).checked' It like is not getting my control from the page.
Also, I remember a whitepaper that microsoft published about upgrading from ie7 to ie8 (it was a long time ago for me), you might want to google/bing and see if you can find it.
That is part of the error i get by putting in the getElementById method as part of a radiobutton control, it seems as if not to find it becuase i think it needs to find the form first then the control on the form for asp.net 1.1 forms but not latter forms
in 2005 and up. I have tried the following.
if document.getElementById("frm").firstchild("rblVTC(1)").checked = true then
if document.getElementById("frm").getElementByTagName("rblVTC(1)").checked = true then
if document.getElementById("frm").parentNode("rblVTC(1)").checked = true then
if document.getElementById("frm").childNode("rblVTC(1)").checked = true then
I don't understand why you think that you have to "find the form first". The elements are, as far as I know part of the document tree. Did you try as the article suggested:
Yes I did and it errors out the HTML when I put in that syntax. Agian i am working on an ASP.net 1.1 project in VS 2003 and not a higher version, in my 2010 projects I can do that and it works fine, but it will not take in the 1.1 project.
If I do this as suggested, think i got wrong syntaxin last post. I still get the same error.
sub rblVTC_onClick()
if document.getElementById("<%= rblVTC.ClientID %>").checked = true then
divJoin.style.display = "inline"
else
divJoin.style.display = "none"
end if
end sub
Webpage error details
Message: Object doesn't support this property or method: 'document.getElementById(...).checked'
Line: 536
Char: 3
Code: 0
Just a suggestion here. It's possible that ASP 1.1 just doesn't play nice with IE8. Have you tried forcing IE8 into IE7 compatibility mode to see if everything works as expected?
Did that already and it did not work, the problem I am finding is that the project uses javascript calls on code behind to vbscipt code and it errors out and does not work. It must be a thing with IE 8.
kldeutsch
Member
126 Points
353 Posts
Javascript code not working IE8.0
Nov 23, 2011 05:23 PM|LINK
I have a project that was written in asp.net 1.1 towards IE 6 and worked with IE 7 but we upgraded a new web server and it has IE 8 and now when we try to build the project it gives us all these javascript errors it never did before, this first example is just on page load to get teh cordinates of scrolling but it gives the error. Is there something we have to do for IE8.0 to accept all this, we even tried in compatability mode and it gave the same errors. As I said we built the project and browsed and got the error but on a IE 7 or Ie 6 we do not get the error
The line it errors out on is this line
Under the function resetscrollposition
<script language="javascript"> function timedCount() { setTimeout("SaveScrollXY()",300000); } function SaveScrollXY() { document.frm.ScrollX.value = document.body.scrollLeft; document.frm.ScrollY.value = document.body.scrollTop; __doPostBack('__Page', ''); } function ResetScrollPosition() { var hidx, hidy; hidx = document.frm.ScrollX; hidy = document.frm.ScrollY; if (typeof hidx != 'undefined' && typeof hidy != 'undefined') { window.scrollTo(hidx.value, hidy.value); } } </script> <body style="margin:0px;font-family:arial;" onload="ResetScrollPosition();"> <form id="frm" method="post" runat="server" onsubmit="SaveScrollXY();"> <table width="100%" cellspacing="0" cellpadding="0" background="Images/headBar.jpg" height="34px;" id="tblHeading" runat="server">kldeutsch
Member
126 Points
353 Posts
Re: Javascript code not working IE8.0
Nov 23, 2011 06:31 PM|LINK
Ok,
I found out that I needed to replace (.frm) with (document.getElementById(Control) for that page and it worked and got rid of the error, but I am having the same propeblme iwth my controls on another page but its the actual form controls, my checkboxes, textboxes so on, I should be able to replace the .frm with above but it keeps telling me another error.
Object doesnt support this property or method 'document.getElementById(....).checked' It like is not getting my control from the page.
RichardY
Star
8376 Points
1573 Posts
Re: Javascript code not working IE8.0
Nov 23, 2011 06:47 PM|LINK
It is not clear to me how you are getting the element id since that is the .... in above. So, if this is not the issue try to clarify.
You want to get the id of the element by calling the ClientId property. Se this:
http://stackoverflow.com/questions/1119018/get-element-by-id-in-javascript
Also, I remember a whitepaper that microsoft published about upgrading from ie7 to ie8 (it was a long time ago for me), you might want to google/bing and see if you can find it.
kldeutsch
Member
126 Points
353 Posts
Re: Javascript code not working IE8.0
Nov 23, 2011 06:57 PM|LINK
hi,
That is part of the error i get by putting in the getElementById method as part of a radiobutton control, it seems as if not to find it becuase i think it needs to find the form first then the control on the form for asp.net 1.1 forms but not latter forms in 2005 and up. I have tried the following.
if document.getElementById("frm").firstchild("rblVTC(1)").checked = true then
if document.getElementById("frm").getElementByTagName("rblVTC(1)").checked = true then
if document.getElementById("frm").parentNode("rblVTC(1)").checked = true then
if document.getElementById("frm").childNode("rblVTC(1)").checked = true then
Each one produced a differnet error
RichardY
Star
8376 Points
1573 Posts
Re: Javascript code not working IE8.0
Nov 23, 2011 07:04 PM|LINK
I don't understand why you think that you have to "find the form first". The elements are, as far as I know part of the document tree. Did you try as the article suggested:
document.GetElementById('<%= rblVTC.CLientID %>');
kldeutsch
Member
126 Points
353 Posts
Re: Javascript code not working IE8.0
Nov 23, 2011 07:06 PM|LINK
Hi,
Yes I did and it errors out the HTML when I put in that syntax. Agian i am working on an ASP.net 1.1 project in VS 2003 and not a higher version, in my 2010 projects I can do that and it works fine, but it will not take in the 1.1 project.
kldeutsch
Member
126 Points
353 Posts
Re: Javascript code not working IE8.0
Nov 23, 2011 07:15 PM|LINK
Hi,
If I do this as suggested, think i got wrong syntaxin last post. I still get the same error.
sub rblVTC_onClick() if document.getElementById("<%= rblVTC.ClientID %>").checked = true then divJoin.style.display = "inline" else divJoin.style.display = "none" end if end sub Webpage error details Message: Object doesn't support this property or method: 'document.getElementById(...).checked' Line: 536 Char: 3 Code: 0rossisdead2
Participant
1313 Points
300 Posts
Re: Javascript code not working IE8.0
Nov 23, 2011 08:07 PM|LINK
Just a suggestion here. It's possible that ASP 1.1 just doesn't play nice with IE8. Have you tried forcing IE8 into IE7 compatibility mode to see if everything works as expected?
Ruchira
All-Star
43056 Points
7040 Posts
MVP
Re: Javascript code not working IE8.0
Nov 24, 2011 05:55 AM|LINK
Try it like below
if document.getElementById('<%= rblVTC.ClientID %>').checked then divJoin.style.display = "inline"
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.kldeutsch
Member
126 Points
353 Posts
Re: Javascript code not working IE8.0
Nov 28, 2011 01:04 PM|LINK
HI,
Did that already and it did not work, the problem I am finding is that the project uses javascript calls on code behind to vbscipt code and it errors out and does not work. It must be a thing with IE 8.