473,856 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help! document.getEle mentById("folde rMenu").cells has no properties when using FireFox

Error: document.getEle mentById("folde rMenu").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(ta bNo) {
tmpTab =
document.getEle mentById("folde rMenu").cells[tabNo].childNodes.ite m(0);
activeTab = tmpTab;
switchTabStyle( tmpTab,true);
document.getEle mentById("divFo lder"+activeTab .getAttribute(" divno")).style. .visibility="vi sible";
}

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

<HTML>
<HEAD>
<TITLE>Tillbeh& ouml;rskataloge n</TITLE>
<LINK TYPE="text/css" REL="stylesheet " HREF="<%=cssPat h%>">
<LINK TYPE="text/css" REL="stylesheet " HREF="css/foldermenu.css" >
<SCRIPT LANGUAGE="Javas cript" SRC="js/foldermenu.js"> </SCRIPT>
<SCRIPT LANGUAGE="JavaS cript" SRC="js/dimlayer.js"></SCRIPT>
<SCRIPT LANGUAGE="Javas cript">
function init() {
setActiveTab(0) ;
clearYear();
}
function enableDropdowns () {
document.getEle mentById("omrad e").disabled = false;
document.getEle mentById("ar"). disabled = false;
}
function disableDropdown s() {
window.iframeMo delGroup.docume nt.getElementBy Id("popmodellna mn").selectedIn dex
= 0;
window.iframeMo delGroup.docume nt.getElementBy Id("popmodellna mn").disabled
= true;
document.getEle mentById("popmo dellnamn").valu e = "";
window.iframeMo delName.documen t.getElementByI d("modellnamn") .selectedIndex
= 0;
window.iframeMo delName.documen t.getElementByI d("modellnamn") .disabled
= true;
document.getEle mentById("model lnamn").value = "";
}
function clearYear() {
document.getEle mentById("ar"). selectedIndex = 1;
disableDropdown s();
document.getEle mentById("ar"). onchange();
}
function getDropdown(ref Form) {
var chBrand = '<%=vchBrand%>' ;
disableDropdown s();
refForm.target= 'iframeModelGro up';
refForm.action= 'getDropDown.as p?type=modelGro up&make=' + chBrand;
refForm.submit( );target='frSta ge';
refForm.target= 'frStage';
refForm.action= 'main.asp?searc hType=Modellkod ';
}
function enableArtNo(mak eID) {
if (makeID != "0") {
document.getEle mentById("artnr ").disabled = false;
} else {
document.getEle mentById("artnr ").disabled = true;
}
}
function enableFritext(m akeID) {
if (makeID != "0") {
document.getEle mentById("frite xt").disabled = false;
} else {
document.getEle mentById("frite xt").disabled = true;
}
}
function checkMake(eleme nt) {
var bOK = false;
if (! document.getEle mentById(elemen t).disabled) {
bOK = true
} else {
alert("Du måste välja märke!");
}
return bOK;
}
function goHome(){
window.parent.f rStage.location = 'start.asp';
}
function visa(){
parent.frStage. document.all.re servationtext.s tyle.visibility =
"visible";
}
function dolj(){
parent.frStage. document.all.re servationtext.s tyle.visibility =
"hidden";
}

//DAVID
function validateSearchF orm() {
if(document.for ms('formRegNr') .regnr.value!=' '){
if(document.for ms('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.for ms('formRegNr') .regnr.value!=' '){
Kategori();
}
else{
alert('Du måste ange ett regnummer');
return;
}

}
function Kategori(){
if(document.for ms('formRegNr') .omrade.value!= 0){
document.forms( 'formRegNr').su bmit();
}
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;
}
#folderMenuHead er {
position: absolute;
left: 20px;
top: 46px;
}
..folderMenuHea derText {
font-family: verdana,arial,h elvetica;
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="img s/tab_bg_2.gif" ONLOAD="init(); " BGCOLOR="#FFFFF F"
LEFTMARGIN="0" TOPMARGIN="0">
<DIV ID="divHeader"> <IMG SRC="imgs/tbk.gif" WIDTH="188" HEIGHT="32"
BORDER="0"></DIV>
<DIV ID="divLogo"><I MG SRC="<%=logoPat h%>" BORDER="0"></DIV>
<TABLE NAME="folderMen u" ID="folderMenu " BORDER="0" CELLPADDING="0"
CELLSPACING="0" ONSELECTSTART=" return false;">
<TR>
<TD><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"
ONCLICK="activa teFolder(this); " DIVNO="0" CLASS="tabConta iner">
<TR>
<TD CLASS="tabLeftO ff" ROWSPAN="3"><IM G SRC="imgs/dutt.gif" WIDTH="12"
HEIGHT="22" BORDER="0"></TD>
<TD WIDTH="100" CLASS="tabTopOf f"><IMG SRC="imgs/dutt.gif" WIDTH="4"
HEIGHT="3" BORDER="0"></TD>
<TD CLASS="tabRight Off" ROWSPAN="3"><IM G SRC="imgs/dutt.gif"
WIDTH="11" HEIGHT="22" BORDER="0"></TD>
</TR>
<TR>
<TD ALIGN="center" CLASS="tabTextO ff">Reg.nr.</TD>
</TR>
<TR>
<TD CLASS="tabBotto mOff"><IMG SRC="imgs/dutt.gif" WIDTH="1" HEIGHT="1"
BORDER="0"></TD>
</TR>
<TR>
<TD COLSPAN="3" CLASS="tabBotto m2Off"><IMG SRC="imgs/dutt.gif"
WIDTH="1" HEIGHT="1" BORDER="0"></TD>
</TR>
</TABLE></TD>
<TD><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"
ONCLICK="activa teFolder(this); " DIVNO="1" CLASS="tabConta iner">
<TR>
<TD CLASS="tabLeftO ff" ROWSPAN="3"><IM G SRC="imgs/dutt.gif" WIDTH="12"
HEIGHT="22" BORDER="0"></TD>
<TD WIDTH="100" CLASS="tabTopOf f"><IMG SRC="imgs/dutt.gif" WIDTH="4"
HEIGHT="3" BORDER="0"></TD>
<TD CLASS="tabRight Off" ROWSPAN="3"><IM G SRC="imgs/dutt.gif"
WIDTH="11" HEIGHT="22" BORDER="0"></TD>
</TR>
<TR>
<TD ALIGN="center" CLASS="tabTextO ff">Modell</TD>
</TR>
<TR>
<TD CLASS="tabBotto mOff"><IMG SRC="imgs/dutt.gif" WIDTH="1" HEIGHT="1"
BORDER="0"></TD>
</TR>
<TR>
<TD COLSPAN="3" CLASS="tabBotto m2Off"><IMG SRC="imgs/dutt.gif"
WIDTH="1" HEIGHT="1" BORDER="0"></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE>
<DIV ID="divFolder0 " CLASS="divFolde r0">
<FORM NAME="formRegNr "
ACTION="main.as p?searchType=Re gNr&brand=<%=vc hBrand%>" METHOD="post"
TARGET="frStage " onsubmit="toggl eDimLayer(true) ; return
validateSearchF orm();">
<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&aum l;lj tillbeh&ouml;rs grupp</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="toggle DimLayer(true); return validateSearchF orm();"
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><INPU T 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ökanvis ning:&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="divFolde r1">
<FORM NAME="formModel Group" ACTION="main.as p?searchType=Mo dellkod"
METHOD="post" TARGET="frStage " ONSUBMIT="toggl eDimLayer(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&aum l;lj tillbeh&ouml;rs grupp</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="getDr opdown(this.for m);">
<OPTION VALUE="1">V&aum l;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="iframeMod elGroup" ID="iframeModel Group"
SRC="getDropDow n.asp?type=mode lGroup&make=<%= vchBrand%>" WIDTH="200"
HEIGHT="22" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="no"
FRAMEBORDER="0" ></IFRAME><BR>
<IFRAME NAME="iframeMod elName" ID="iframeModel Name"
SRC="getDropDow n.asp?type=mode lName&make=<%=v chBrand%>" 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">&nbs p;<!--b>Visa pris (Inkl. moms)</b-->
</td>
</TR>
</TABLE>
<INPUT TYPE="hidden" NAME="popmodell namn" VALUE="">
<INPUT TYPE="hidden" NAME="modellnam n" VALUE="">
</FORM>
</DIV>
<div STYLE="position :absolute; right:10; bottom:10; z-index:10;">
<a href="#" onMouseOver="vi sa()" onMouseOut="dol j()"><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 9281


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


The expression document.getEle mentById("folde rMenu") 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.c om/faq/faq_notes/not_browser_det ect.html>

Your example assumes the object returned by that document.getEle mentById
call has a property named cells which it does not have in Firefox so you
would need to check e.g.
var table = document.getEle mentById('table Id');
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
10458
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 Opera! But we are receiving feedback that some users are receiving the file does not begin with %PDF message. ExecString = "spwEcoTrackUser " & Session("EcoUserID") & ",'coupon'," & ID set dbConn = Server.CreateObject("ADODB.Command")...
7
38037
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 using innerHTML. Now, I've researched this problem on the web, and found many references to it, but none of them quite addressed my specific situation, and since my experience with JavaScript is limited, I was not able to adapt the solutions I...
2
2555
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: Both the client and server components are written in c#, windows forms for the front-end and the back end is exposed through IIS using webservices. We are using Impersonate in the web.config. The application is a warehouse inventory system,...
2
3868
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 present and generated when the page is requested using IE. Confusing. Anything I can do? <%= Clinton Gallagher NET csgallagher AT metromilwaukee.com URL http://clintongallagher.metromilwaukee.com/
0
1016
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 a specific category link) The issue is this page works fine when it is a separate page but when I try to include this to my Master page, the content page does not display. The Values are passed correctly as I can see it in the URL but, a small...
2
2387
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
2430
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 when using firefox, with IE it just shows the iframe. Does anyone know how to solve this, Thank you very much, Greetz,
6
7399
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 database and a table. However, I am having difficulty getting the values from an excel and putting them into the table. The Excel document has just three columns, which are: MATCH - this is just a four digit number DATE - this is just a date in the...
0
9755
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11048
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10770
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10376
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7928
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7084
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5754
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4168
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3194
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.