473,238 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

Help! document.getElementById("folderMenu").cells has no properties when using FireFox

Error: document.getElementById("folderMenu").cells has no properties
File: http://www.volkswagen.se/tillbehor/js/foldermenu.js
Rad: 49

The function activates different DIV:s, but doesn't seem to work on
FireFox or Netscape. What could be wrong?

The function:

function setActiveTab(tabNo) {
tmpTab =
document.getElementById("folderMenu").cells[tabNo].childNodes.item(0);
activeTab = tmpTab;
switchTabStyle(tmpTab,true);
document.getElementById("divFolder"+activeTab.getA ttribute("divno")).style..visibility="visible";
}

The file with the DIV:s and Tables from where the function is called,
in the init() fuction:

<HTML>
<HEAD>
<TITLE>Tillbeh&ouml;rskatalogen</TITLE>
<LINK TYPE="text/css" REL="stylesheet" HREF="<%=cssPath%>">
<LINK TYPE="text/css" REL="stylesheet" HREF="css/foldermenu.css">
<SCRIPT LANGUAGE="Javascript" SRC="js/foldermenu.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="js/dimlayer.js"></SCRIPT>
<SCRIPT LANGUAGE="Javascript">
function init() {
setActiveTab(0);
clearYear();
}
function enableDropdowns() {
document.getElementById("omrade").disabled = false;
document.getElementById("ar").disabled = false;
}
function disableDropdowns() {
window.iframeModelGroup.document.getElementById("p opmodellnamn").selectedIndex
= 0;
window.iframeModelGroup.document.getElementById("p opmodellnamn").disabled
= true;
document.getElementById("popmodellnamn").value = "";
window.iframeModelName.document.getElementById("mo dellnamn").selectedIndex
= 0;
window.iframeModelName.document.getElementById("mo dellnamn").disabled
= true;
document.getElementById("modellnamn").value = "";
}
function clearYear() {
document.getElementById("ar").selectedIndex = 1;
disableDropdowns();
document.getElementById("ar").onchange();
}
function getDropdown(refForm) {
var chBrand = '<%=vchBrand%>';
disableDropdowns();
refForm.target='iframeModelGroup';
refForm.action='getDropDown.asp?type=modelGroup&ma ke=' + chBrand;
refForm.submit();target='frStage';
refForm.target='frStage';
refForm.action='main.asp?searchType=Modellkod';
}
function enableArtNo(makeID) {
if (makeID != "0") {
document.getElementById("artnr").disabled = false;
} else {
document.getElementById("artnr").disabled = true;
}
}
function enableFritext(makeID) {
if (makeID != "0") {
document.getElementById("fritext").disabled = false;
} else {
document.getElementById("fritext").disabled = true;
}
}
function checkMake(element) {
var bOK = false;
if (! document.getElementById(element).disabled) {
bOK = true
} else {
alert("Du måste välja märke!");
}
return bOK;
}
function goHome(){
window.parent.frStage.location = 'start.asp';
}
function visa(){
parent.frStage.document.all.reservationtext.style. visibility =
"visible";
}
function dolj(){
parent.frStage.document.all.reservationtext.style. visibility =
"hidden";
}

//DAVID
function validateSearchForm() {
if(document.forms('formRegNr').regnr.value!=''){
if(document.forms('formRegNr').omrade.value!=0){
return true;
}
else{
alert('Du måste ange en kategori');
toggleDimLayer(false);
return false;
}
}
else{
alert('Du måste ange ett regnummer');
toggleDimLayer(false);
return false;
}
}
//DAVID

function CheckReg(){
if(document.forms('formRegNr').regnr.value!=''){
Kategori();
}
else{
alert('Du måste ange ett regnummer');
return;
}

}
function Kategori(){
if(document.forms('formRegNr').omrade.value!=0){
document.forms('formRegNr').submit();
}
else{
alert('Du måste ange en kategori');
return;
}
}
</SCRIPT>
<STYLE TYPE="text/css">
..divFolder0 {
position: absolute;
visibility: visible;
left: 20px;
top: 80px;
}
..divFolder1 {
position: absolute;
visibility: hidden;
left: 20px;
top: 80px;
}
#divHeader {
position: absolute;
visibility: visible;
left: 586px;
top: 15px;
}
#folderMenuHeader {
position: absolute;
left: 20px;
top: 46px;
}
..folderMenuHeaderText {
font-family: verdana,arial,helvetica;
font-size: 12px;
font-weight: bold;
}
#divLogo {
position: absolute;
visibility: visible;
left: 10px;
top: 9px;
}
#divTBKS {
position: absolute;
visibility: visible;
left: 335px;
top: 5px;
}
</STYLE>
</HEAD>
<BODY BACKGROUND="imgs/tab_bg_2.gif" ONLOAD="init();" BGCOLOR="#FFFFFF"
LEFTMARGIN="0" TOPMARGIN="0">
<DIV ID="divHeader"><IMG SRC="imgs/tbk.gif" WIDTH="188" HEIGHT="32"
BORDER="0"></DIV>
<DIV ID="divLogo"><IMG SRC="<%=logoPath%>" BORDER="0"></DIV>
<TABLE NAME="folderMenu" ID="folderMenu" BORDER="0" CELLPADDING="0"
CELLSPACING="0" ONSELECTSTART="return false;">
<TR>
<TD><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"
ONCLICK="activateFolder(this);" DIVNO="0" CLASS="tabContainer">
<TR>
<TD CLASS="tabLeftOff" ROWSPAN="3"><IMG SRC="imgs/dutt.gif" WIDTH="12"
HEIGHT="22" BORDER="0"></TD>
<TD WIDTH="100" CLASS="tabTopOff"><IMG SRC="imgs/dutt.gif" WIDTH="4"
HEIGHT="3" BORDER="0"></TD>
<TD CLASS="tabRightOff" ROWSPAN="3"><IMG SRC="imgs/dutt.gif"
WIDTH="11" HEIGHT="22" BORDER="0"></TD>
</TR>
<TR>
<TD ALIGN="center" CLASS="tabTextOff">Reg.nr.</TD>
</TR>
<TR>
<TD CLASS="tabBottomOff"><IMG SRC="imgs/dutt.gif" WIDTH="1" HEIGHT="1"
BORDER="0"></TD>
</TR>
<TR>
<TD COLSPAN="3" CLASS="tabBottom2Off"><IMG SRC="imgs/dutt.gif"
WIDTH="1" HEIGHT="1" BORDER="0"></TD>
</TR>
</TABLE></TD>
<TD><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"
ONCLICK="activateFolder(this);" DIVNO="1" CLASS="tabContainer">
<TR>
<TD CLASS="tabLeftOff" ROWSPAN="3"><IMG SRC="imgs/dutt.gif" WIDTH="12"
HEIGHT="22" BORDER="0"></TD>
<TD WIDTH="100" CLASS="tabTopOff"><IMG SRC="imgs/dutt.gif" WIDTH="4"
HEIGHT="3" BORDER="0"></TD>
<TD CLASS="tabRightOff" ROWSPAN="3"><IMG SRC="imgs/dutt.gif"
WIDTH="11" HEIGHT="22" BORDER="0"></TD>
</TR>
<TR>
<TD ALIGN="center" CLASS="tabTextOff">Modell</TD>
</TR>
<TR>
<TD CLASS="tabBottomOff"><IMG SRC="imgs/dutt.gif" WIDTH="1" HEIGHT="1"
BORDER="0"></TD>
</TR>
<TR>
<TD COLSPAN="3" CLASS="tabBottom2Off"><IMG SRC="imgs/dutt.gif"
WIDTH="1" HEIGHT="1" BORDER="0"></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE>
<DIV ID="divFolder0" CLASS="divFolder0">
<FORM NAME="formRegNr"
ACTION="main.asp?searchType=RegNr&brand=<%=vchBran d%>" METHOD="post"
TARGET="frStage" onsubmit="toggleDimLayer(true); return
validateSearchForm();">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD><B>Reg.nr.</B></TD>
<TD STYLE="padding-left: 10px"><INPUT TYPE="text" NAME="regnr"
CLASS="regnr" MAXLENGTH="6"><IMG SRC="imgs/bg_trans.gif" WIDTH="140"
HEIGHT="1" BORDER="0"></TD>
<TD STYLE="padding-left: 20px;">&nbsp;</TD>
<TD STYLE="padding-left: 20px;"><SELECT NAME="omrade" CLASS="dd">
<OPTION VALUE="0">V&auml;lj tillbeh&ouml;rsgrupp</OPTION>
<%=strCat%>
<% '<OPTION VALUE="-1" <% If CInt(omrade) = -1
Then>Paket</OPTION>
%>
</SELECT></TD>
<TD STYLE="padding-left: 16px;"><SPAN CLASS="bnBorder"><INPUT
TYPE="submit" CLASS="bn" VALUE="S&ouml;k"
onclick="toggleDimLayer(true); return validateSearchForm();"
HIDEFOCUS></SPAN></TD>
<TD STYLE="padding-left: 16px;"><SPAN CLASS="bnBorder"><INPUT
TYPE="button" CLASS="bn" VALUE="Start" onClick="goHome();"
HIDEFOCUS></SPAN></TD>
</TR>
<TR STYLE="padding-top: 7px;">
<TD COLSPAN="2"></TD>
<TD STYLE="padding-left: 40px;" colspan=2><INPUT type="hidden"
CLASS="chk" TYPE="checkbox" NAME="pris" value="1"
ID="pris">&nbsp;<!--b>Visa pris (Inkl. moms)</b--></TD>
</TR>
<TR>
<TD colspan="5">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD><B>Sökanvisning:&nbsp;</B></TD>
<TD><B>1</B>&nbsp;Skriv reg. nummer.</TD>
</TR>
<TR>
<TD>&nbsp;</TD>
<TD><B>2</B>&nbsp;Välj tillbehörsgrupp</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</FORM>
</DIV>
<DIV ID="divFolder1" CLASS="divFolder1">
<FORM NAME="formModelGroup" ACTION="main.asp?searchType=Modellkod"
METHOD="post" TARGET="frStage" ONSUBMIT="toggleDimLayer(true);">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD VALIGN="top" STYLE="padding-left: 30px;"><SELECT NAME="omrade"
CLASS="dd">
<OPTION VALUE="1">V&auml;lj tillbeh&ouml;rsgrupp</OPTION>
<%=strCat%>
<%'<OPTION VALUE="-1"<% If CInt(omrade) = -1 Then>Paket</OPTION>
%>
</SELECT></TD>
<TD VALIGN="top" STYLE="padding-left: 30px;">
<SELECT NAME="ar" CLASS="dd" STYLE="margin-bottom: 4px;"
ONCHANGE="getDropdown(this.form);">
<OPTION VALUE="1">V&auml;lj &aring;r</OPTION>
<%=strYear%>
</SELECT>
</TD>
<TD VALIGN="top" STYLE="padding-left: 16px;"><SPAN
CLASS="bnBorder"><INPUT TYPE="submit" CLASS="bn" VALUE="S&ouml;k"
HIDEFOCUS ID="Submit1" NAME="Submit1"></SPAN></TD>
<TD VALIGN="top" STYLE="padding-left: 16px;"><SPAN
CLASS="bnBorder"><INPUT TYPE="button" CLASS="bn" VALUE="Start"
onClick="goHome();" HIDEFOCUS id=button1 name=button1></SPAN></TD>

<TR>
<TD colspan="2">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD>&nbsp;</TD>
<TD><B>1</B>&nbsp;Välj tillbehörsgrupp.</TD>
</TR>
<TR>
<TD>&nbsp;</TD>
<TD><B>2</B>&nbsp;Ändra ev. årsmodell. Välj modellgrupp och
modell.</TD>
</TR>
</TABLE>
</TD>
<TD VALIGN="top" STYLE="padding-left: 30px;">
<IFRAME NAME="iframeModelGroup" ID="iframeModelGroup"
SRC="getDropDown.asp?type=modelGroup&make=<%=vchBr and%>" WIDTH="200"
HEIGHT="22" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no"
FRAMEBORDER="0"></IFRAME><BR>
<IFRAME NAME="iframeModelName" ID="iframeModelName"
SRC="getDropDown.asp?type=modelName&make=<%=vchBra nd%>" WIDTH="200"
HEIGHT="20" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no"
FRAMEBORDER="0"></IFRAME>
</TD>
<TD VALIGN="top" STYLE="padding-left: 40px;" colspan=2>
<INPUT TYPE="hidden" CLASS="chk" NAME="pris" value="1"
ID="pris1">&nbsp;<!--b>Visa pris (Inkl. moms)</b-->
</td>
</TR>
</TABLE>
<INPUT TYPE="hidden" NAME="popmodellnamn" VALUE="">
<INPUT TYPE="hidden" NAME="modellnamn" VALUE="">
</FORM>
</DIV>
<div STYLE="position:absolute; right:10; bottom:10; z-index:10;">
<a href="#" onMouseOver="visa()" onMouseOut="dolj()"><img
SRC="imgs/info_icon.gif" ALT BORDER="0"></a>
</table>
</div>
</BODY>
</HTML>

Hope somebody has any ideas!

Thanks in advance!

/David

Sep 14 '05 #1
3 9225


da*************@hotmail.com wrote:
Error: document.getElementById("folderMenu").cells has no properties
File: http://www.volkswagen.se/tillbehor/js/foldermenu.js
Rad: 49 tmpTab =
document.getElementById("folderMenu").cells[tabNo].childNodes.item(0); <TABLE NAME="folderMenu" ID="folderMenu" BORDER="0" CELLPADDING="0"
CELLSPACING="0" ONSELECTSTART="return false;">


The expression document.getElementById("folderMenu") gives you a HTML
<table> element object which implements the interface specified here:
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-64060425>
It has a property named rows which is a collection to access the rows in
the table and for each row you have a cells collection but not for the
table itself.

So correct your script, use some feature checks to avoid errors where
properties are not implemented.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 14 '05 #2
Thanks for your answer! But I still don´t really get it, could you
give me an example of what you mean?

Regards,
David

Sep 14 '05 #3


davkar wrote:
Thanks for your answer! But I still don´t really get it, could you
give me an example of what you mean?


Feature/object detection?
See
<http://jibbering.com/faq/#FAQ4_26>
<http://www.jibbering.com/faq/faq_notes/not_browser_detect.html>

Your example assumes the object returned by that document.getElementById
call has a property named cells which it does not have in Firefox so you
would need to check e.g.
var table = document.getElementById('tableId');
if (table && table.cells) {
// now use table.cells here e.g.
var cell = table.cells[0];
if (cell) {
// now use cell here
}
}

Of course depending on what you want to achieve you might not want to
use table.cells at all but go for some more cross browser way.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: TrailBlazer | last post by:
Hi - Been struggling over this issue for a long while. We store PDF's in our SQL Server database. And I do a BinaryWrite to display the PDF. It works for me without issue, on FireFox, IE, and...
7
by: John | last post by:
Hi Everyone, I'm having this extremely annoying problem with Internet Explorer 6, giving me an error message saying "unknown runtime error" whenever I try to alter the contents of a <divelement...
2
by: Spottswoode | last post by:
Hi I have developed a client/server application in C# that worked perfectly in my office but not so perfectly after deploying it to our client. A little information about the architecture first:...
2
by: clintonG | last post by:
When selected="true" is declared in the CheckBoxList ListItem FireFox does not display checked list items. Even more curious is the absence of the checked="checked" attribute in the source which is...
0
by: mrpage | last post by:
I have developed a page that uses a ASP.Datalist control to display details including images in a database. The page uses parameters passed by links from the home page (i.e, category ID when clicking...
2
by: Joey | last post by:
This is causing us a lot of pain right now. Does anyone know why this happens and, more importantly, how to fix it? TIA JP
2
Patropia
by: Patropia | last post by:
Hi, I have an iframe that's using designMode in which I'm loading some code. When including an iframe in that code (putting an iframe in the iframe) the entire frame goes blank. This only happens...
6
by: ronparker | last post by:
Hello, This is my first time posting and just my second day using python on mysql, so please be patient with me. I should also say, I am using a linux machine. Using python I was able to make a...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.