473,545 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error message "object required"

110 New Member
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 "tableQuestion1 7"

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 7594
acoder
16,027 Recognized Expert Moderator MVP
Where does this line get called?
Jan 12 '09 #2
andersond
110 New Member
onChange="javas cript:question( '17')"
Jan 12 '09 #3
acoder
16,027 Recognized Expert Moderator MVP
OK, can you post the question() function code.
Jan 12 '09 #4
andersond
110 New Member
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 Recognized Expert Moderator MVP
There's no swapNode method. Have you added it via prototype?
Jan 12 '09 #6
andersond
110 New Member
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 New Member
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 Recognized Expert Moderator MVP
@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 New Member
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

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

Similar topics

1
1905
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 email providers entry point which they refered to as "smtp server for asp mail" and I'm wondering if it's the asp aspect. .NET has no documentation...
2
1550
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 set to an instance of an object" Can anyone please tell me how i can solve this problem? Thanks in advance,
3
1922
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 access 'CDO.Message' object.". Can anybody help me to solve this probelm
1
2690
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our...
3
9246
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our...
4
3961
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. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80004005):...
18
28719
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, FontStyle.Bold), Brushes.Black, 0, 0) Why is this? Marc
2
2967
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 to the same page at the top of my form alerting the user that their request has been approved or denied. However, the end result is an error...
5
22109
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 know hardly anything when it comes to JavaScript, and I keep getting an error saying: "Error: Object required Line: 31 Char: 1 Code: 0"
4
3086
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 System.EventArgs) Handles Button1.Click Hiddenfield1.value="end text" end sub
0
7487
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7420
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...
0
7680
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. ...
0
7934
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6003
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5349
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...
0
4966
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...
1
1908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.