473,385 Members | 1,597 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,385 software developers and data experts.

error message "object required"

110 100+
On a webpage that has a variety of questions I get an "object required" error on lines like this...

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('tableQuestion17').style.visibility="visible";
  2.  
This is the code for the table "tableQuestion17"

Expand|Select|Wrap|Line Numbers
  1. <table border="0" width="100%" id="tableQuestion17" cellpadding="0" style="visibility:hidden">
  2.             <tr>
  3.                   <td bgcolor="#003300" style="padding-right: 5px" width="55%">
  4.                   <p align="right"><b>
  5.                   <font color="#FFFFFF" size="2" face="Arial Narrow">Specify 
  6.                   other method:</font></b></td>
  7.                   <td width="45%" style="border: 1px solid #003300; padding-left: 3px; padding-top: 3px; padding-bottom: 3px">
  8.                  <input type="text" name="otherMethod" id="otherMethod" onChange="javascript:question('17')" size="60" style="border: 1px solid #003300; font-family:Arial Narrow; font-size:10pt; color:#000080;" tabindex="-1" ></td>
  9.                 </tr>
  10.           </table>
  11.  
I really don't get it. Why does javascript not accept this object?
Jan 12 '09 #1
10 7575
acoder
16,027 Expert Mod 8TB
Where does this line get called?
Jan 12 '09 #2
andersond
110 100+
onChange="javascript:question('17')"
Jan 12 '09 #3
acoder
16,027 Expert Mod 8TB
OK, can you post the question() function code.
Jan 12 '09 #4
andersond
110 100+
The entire function is over 1200 lines; and, I know you don't really want that, here is the portion in question

Expand|Select|Wrap|Line Numbers
  1. function question(x){
  2.  
  3.  if(x=="17"){// describe the 'other' method
  4.    document.getElementById('tableCompletionFeedback').background="../Images/completionBLUE51%25.jpg";
  5.    document.getElementById('percent').style.fontFamily="Arial Narrow"; 
  6.    document.getElementById('percent').style.fontSize="10pt";
  7.    document.getElementById('percent').align="right";
  8.    document.getElementById('percent').innerHTML="51% complete"; 
  9.    document.getElementById('tableQuestion18').swapNode(document.getElementById('tableRow3'));
  10.    document.getElementById('tableQuestion18').style.visibility="visible";
  11.    document.getElementById('tableQuestion18').id="item3";
  12.    document.getElementById('cellOutput17').style.fontFamily="Arial Narrow"; 
  13.    document.getElementById('cellOutput17').style.fontSize="10pt"; 
  14.    document.getElementById('cellOutput17').innerHTML="Valuation method is: "+rtrim(document.getElementById('otherMethod').value);
  15.    document.getElementById('coinsurance').focus();
  16.    }
  17. }
  18.  
Jan 12 '09 #5
acoder
16,027 Expert Mod 8TB
There's no swapNode method. Have you added it via prototype?
Jan 12 '09 #6
andersond
110 100+
Trust me the problem is within the code I have already posted. But just for good measure, here's swapNode, which is a function I have used time and again.

Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  2. <title>Vacant Buildings Submission Manager</title>
  3. <script type="text/javascript; version=1.5">
  4. Node.prototype.swapNode = function (node) {
  5.   var nextSibling = this.nextSibling;
  6.   var parentNode = this.parentNode;
  7.   node.parentNode.replaceChild(this, node);
  8.   parentNode.insertBefore(node, nextSibling);
  9.   }  
  10. </script>
  11.  
Jan 13 '09 #7
andersond
110 100+
I should also mention that it displays the error message but it still performs the function as it is supposed to do.
Jan 13 '09 #8
acoder
16,027 Expert Mod 8TB
@andersond
which does answer my question - you added it via prototype.

The error message makes me think it's in IE. Have you tried other browsers for something more useful?
Jan 14 '09 #9
andersond
110 100+
FireFox gets so bogged down with "object has no properties" messages that it crashes before it ever gets to this point. But, it has to work in IE. Our website tracking software says that every one of our clients uses IE.
Jan 14 '09 #10
acoder
16,027 Expert Mod 8TB
It can work in both, or more precisely, most (if not all) browsers with a little careful thinking to leave no-one out and avoid losing visitors.

Do you have a link? To pinpoint the problem, you need to find the exact lines and more useful error messages. IE is quite bad at line numbers. You may also find a debugger such as Firebug useful.
Jan 14 '09 #11

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

Similar topics

1
by: M D | last post by:
For the code see MS knowledge base #310273. All I did was comment out the parts for adding an attachment and put real values in for smtpServer & email addresses. For the SmtpServer I used my...
2
by: tJ | last post by:
Hi I'm working on a form with a splitControl. In the RHS panel2, I need to add a panel to drop radioButtons onto. But when i do this, I get the following error message: "Object reference not...
3
by: Jibu | last post by:
Hi I am using SmtpMail class for mail sending. I could able to send mail using my mailse server to our LAN. But when I tried external addresses it showed the exception Message "Could not...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
4
by: Liz Patton | last post by:
Here's the exception: System.Exception: Unable to send mail: Could not access 'CDO.Message' object. ---> System.Web.HttpException: Could not access 'CDO.Message' object. --->...
18
by: Microsoft | last post by:
When I try this in my code I alwas get an errormessage: "Object reference not set to an instance of an object" Dim g As System.Drawing.Graphics g.DrawString("Test", New Font("Arial", 12,...
2
by: louie.hutzel | last post by:
This JUST started happening, I don't remember changing any code: When I click the submit button on my form, stuff is supposed to happen (which it does correctly) and a result message is posted back...
5
by: DaFallus | last post by:
I'm trying to write a somewhat simple page with dependent drop-down boxes. Unfortunately the entire page is written through PL/SQL so that makes it even more difficult for me to trouble shoot. I...
4
by: Phil | last post by:
Hi, This code gives an javascript error: "Object required" and never let see the Alert window. in code-behind: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.