473,325 Members | 2,792 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,325 software developers and data experts.

document.getElementById(objID) has no properties

1
Hi

I have a problem with the following javascript in firefox (works fine in IE). I've done some reading and found that i need to pass in the element ID, but i cant figure out how to do it.

Here's the code. Hope someone can help:

Expand|Select|Wrap|Line Numbers
  1. function get_Style_Obj(objID)
  2. {
  3.     var StyleObj;
  4.  
  5.     if (document.getElementById) // this is the way the standards work
  6.     {
  7.         StyleObj = document.getElementById(objID).style;
  8.     }
  9.     else if (document.all) // this is the way old msie versions work
  10.     {
  11.         StyleObj = document.all[objID].style;
  12.     }
  13.     else if (document.layers) // this is the way nn4 works
  14.     {
  15.         StyleObj = document.layers[objID].style;
  16.     }
  17.     else
  18.     {
  19.         StyleObj = false;
  20.     }
  21.  
  22.     return StyleObj;
  23. }
  24.  
  25. var StyleObj_Continue;
  26.     var StyleObj_Msg;
  27.     var MsgID;
  28.     var ContinueID = 'Continue';
  29.  
  30.     //Validate student has completed enough details to submit application
  31.     if(v_s_citizenship_type == 'DOMESTIC') //DOMESTIC
  32.     {
  33.             MsgID = 'DOMESTIC_msg';
  34.     }
  35.     else //INTERNATIONAL
  36.     {
  37.             MsgID = 'INTRNTNL_msg';
  38.     }
  39.  
  40.     if(MsgID) //if MsgID is set - then make that element visible and hide the Continue element
  41.     {
  42.         StyleObj_Continue = get_Style_Obj(ContinueID);
  43.         StyleObj_Continue.display = "none";
  44.  
  45.         StyleObj_Msg = get_Style_Obj(MsgID+'1'); //top msg
  46.         StyleObj_Msg.display = "block";
  47.  
  48.         StyleObj_Msg = get_Style_Obj(MsgID+'2'); //bottom msg
  49.         StyleObj_Msg.display = "block";
  50.     }
  51.  
[Please use CODE tags when posting source code. Thanks! --pbmods]
Jun 17 '07 #1
2 2868
pbmods
5,821 Expert 4TB
Moving to the JavaScript forum....
Jun 17 '07 #2
gits
5,390 Expert Mod 4TB
hi ...

the message: document.getElementById(objID) has no properties gives you the hint that there is no node with the given ID in the document. please show us the call of the function ... where you have to pass the ID ... and be sure there is an element with that id in your page ...

kind regards...
Jun 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: CJ | last post by:
Hi In my PHP script I'm able to update bookmarks without in hassles but document properties just don't work! I know in VB custom properties can be changed with the following: ...
3
by: StrongBad | last post by:
Does anyone know of a way to access the document properties of an office document using ASP? I need to be able to read things like the Title, Author, and Comments fields and pull that information...
1
by: Patrick Conway | last post by:
Hi! I'm building a Windows form that allows users to view a list of files (and their properties(metadata)) stored in a certain directory. All of the files in the directory are a result of a...
0
by: clintonG | last post by:
Does somebody have code or documented methodology that will audit controls in the framework to generate the names and values for the properties each control uses? <%= Clinton Gallagher...
0
by: Alan T | last post by:
I have modified custom properties of a Word document by code. And there are fields in this Word document link to the properties, however, after running the application and reopen the document, the...
4
by: Morgan | last post by:
Hello! I'm trying to find out if it's possible to access the properties of an document uploaded via the fileupload control? The end goal is to dynamically insert the number of pages in a document...
0
by: Support | last post by:
Hello: Apparently we can read and write to Document Properties using Dsofile.dll (seel http://support.microsoft.com/?id=224351) My question is: can this be extended to non-native Microsoft...
3
by: Maurizio | last post by:
I create an application with Access 2000 and I wish to read/write the properties of a specified word document. I use dsofile.dll my code is Function fGetDocProps(strInFile As String, strProp As...
0
by: hannahhhh1056 | last post by:
Hello! I´m trying to create a makro that finds the text in a wddocument formatted as "heading 1" and then puts it in the document properties. I know how to get the text into doc properties but i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.