473,473 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 9235


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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.