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

Object doesn't support this property or method

Could I get some help on whats going on here. This thing worked in a
previous incarnation. The only change (as my feeble memory recalls) was
changes to the formating of the page.

Help!

http://www.thepurrfectnanny.com/map.php

Code block that errors is:

//Map Change function
function changeMap(){
//user_input = "kennesaw";
user_input = "";
for (i=0;i<document.forms[0].c1.length;i++) {
if (document.forms[0].c1[i].checked) {
user_input = document.forms[0].c1[i].value;
}
}
city = user_input;
onLoad(city);

}

Jan 18 '07 #1
5 2156
Daz

Darkstar 3D wrote:
Could I get some help on whats going on here. This thing worked in a
previous incarnation. The only change (as my feeble memory recalls) was
changes to the formating of the page.

Help!

http://www.thepurrfectnanny.com/map.php

Code block that errors is:

//Map Change function
function changeMap(){
//user_input = "kennesaw";
user_input = "";
for (i=0;i<document.forms[0].c1.length;i++) {
if (document.forms[0].c1[i].checked) {
user_input = document.forms[0].c1[i].value;
}
}
city = user_input;
onLoad(city);

}
Can you provide any hints as to the error you are seeing?

Jan 18 '07 #2
VK
Ref. Object doesn't support this property or method

Because you were a very bad boy :-) so you did not pre-declare
user_input variable neither in global nor in local scope:
var user_input;
or
var user_input = "something';

Somewhere on your page you also have added an element with
id="user_input". On IE (always) and on Gecko (in BackCompat mode) it
leads to auto-created variable "user_input" referencing that element.
Because you did not use var the system assumes that you are trying to
assign empty string to that DOM element reference and this is indeed
not allowed.

Jan 18 '07 #3
Daz

VK wrote:
Ref. Object doesn't support this property or method

Because you were a very bad boy :-) so you did not pre-declare
user_input variable neither in global nor in local scope:
var user_input;
or
var user_input = "something';

Somewhere on your page you also have added an element with
id="user_input". On IE (always) and on Gecko (in BackCompat mode) it
leads to auto-created variable "user_input" referencing that element.
Because you did not use var the system assumes that you are trying to
assign empty string to that DOM element reference and this is indeed
not allowed.
It's good practise to always use 'var' when declaring variables, unless
you have a specific reason not to. 'var' will make the variable private
to the scope it's in, and it should therefore save a lot of coding
problems, such as the one you experienced. I can't believe I didn't
spot it. Nice site by the way. :)

Daz.

Jan 18 '07 #4
VK wrote:
Ref. Object doesn't support this property or method

Because you were a very bad boy :-) so you did not pre-declare
user_input variable neither in global nor in local scope:
var user_input;
or
var user_input = "something';

Somewhere on your page you also have added an element with
id="user_input". On IE (always) and on Gecko (in BackCompat mode) it
leads to auto-created variable "user_input" referencing that element.
Because you did not use var the system assumes that you are trying to
assign empty string to that DOM element reference and this is indeed
not allowed.
Wow! I must have blinders on. :) Think I was too focused on the
conversion or something.

Mucho thanks! Great explanation too as I learned a bit as well.

Jan 19 '07 #5

Daz wrote:
It's good practise to always use 'var' when declaring variables, unless
you have a specific reason not to. 'var' will make the variable private
to the scope it's in, and it should therefore save a lot of coding
I do try, still fuming that I missed some. Although, I must admit that
I don't do webpages for a living, but this client was the wife! :)
Nice site by the way. :)
Thanks!

Jan 19 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matt | last post by:
I tried to display all html control types in the form. But it has run time error "object doesn't support this property or method" on document.write(obj.type); Even I do document.write('hello...
2
by: Olaf | last post by:
I have a frameset page witch contains the myFuc() function. The function is accessed from a page in one of the frames in the frameset. An example is shown below. <input...
3
by: news.onetel.net.uk | last post by:
I and my friend Karl have spent literally all day trying to find out what is causing my error but we are zapped of any further functionality :) I have a form that adds news records. You select...
54
by: tshad | last post by:
I have a function: function SalaryDisplay(me) { var salaryMinLabel = document.getElementById("SalaryMin"); salaryMinLabel.value = 200; alert("after setting salaryMinLabel = " +...
0
by: fniles | last post by:
I created a CAB file for a 3rd party control (StockChartX) it using CABARC.exe that comes from Microsoft SDK. In the CAB file I included the StockChartX.ocx and StockChartX.INF. Then, I signed the...
7
by: stellstarin | last post by:
hi all, I have a HTML page with two forms. While trying to add a hidden element in a first form by the default javascript function, the error message 'object does not support this property or...
5
by: John Olbert | last post by:
Subject: Error is Object doesn't support this property or method I am trying to pass a C# string under Vs2005 (Net2) to an Vb6 ActiveX Control. I get the following runtime error-- "Object...
8
by: Kevin Blount | last post by:
I'm tyring to access an object created by using a method from a third party API. The documentation tells me what object should be return, and the properties of that object, but when I try and...
0
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
9
by: Peter Webb | last post by:
I want to animate one object moving in front of another. I cannot re-render the background as the object moves, as it would be extremely time consuming. This is what I would like to do. I draw...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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
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...
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...

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.