473,714 Members | 2,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript error headache: object doesn't support this property or method

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 'City' then you select
'Business Category' - now when you select 'Business Category' the next
drop-down menu (business sub category) should populate with 'Business
Sub-categories' related to the 'Business Category' but once 'Business
Category' is selected I get the javascript error:

Line: 98
char: 25
error: object doesn't support this property or method
code: 0

Can anyone save us?

This is the URL: http://www.workwise-ely.org/directory/add.php

This is the siurce: http://www.workwise-ely.org/directory/form.txt

On the 'business_categ ory' I am using
onchange="this. form.ac.value=' delete';this.fo rm.submit()
Many thanks
Jul 23 '05 #1
3 11472
In article <41******@212.6 7.96.135>, mi*****@colby.n et enlightened us with...

This is the URL: http://www.workwise-ely.org/directory/add.php


Netscape says:
this.form.submi t is not a function
when I change the business category select element.

I cannot for the life of me find the script that runs with the onchange of
your form fields to populate the boxes. The error's in there somewhere with
the scope of the 'this' keyword.

--
--
~kaeli~
Why did kamikaze pilots wear helmets?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
"news.onetel.ne t.uk" wrote:
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 'City' then you select
'Business Category' - now when you select 'Business Category' the next
drop-down menu (business sub category) should populate with 'Business
Sub-categories' related to the 'Business Category' but once 'Business
Category' is selected I get the javascript error:

Line: 98
char: 25
error: object doesn't support this property or method
code: 0

Can anyone save us?

This is the URL: http://www.workwise-ely.org/directory/add.php

This is the siurce: http://www.workwise-ely.org/directory/form.txt

On the 'business_categ ory' I am using

onchange="this. form.ac.value=' delete';this.fo rm.submit()

Many thanks


I see onchange="form. pr.ac.value='pr ';form.pr.submi t()" for the
business_catego ry, not what you've got listed above.

Presumably you mean "this.form.pr.a c.value....", but "pr" is not a property of
the form, it's the id of the form, and "this.form" gives you a reference to that
form, the id is not required.

So, to set the value of another input you'd use
onchange="this. form.ac.value=' whatever';this. form.submit();"

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq

Jul 23 '05 #3
On Mon, 9 Aug 2004 16:45:33 +0100, news.onetel.net .uk <mi*****@colby. net>
wrote:
I have a form that adds news records. You select 'City' then youselect
'Business Category' - now when you select 'BusinessCatego ry'the next
drop-down menu (business sub category) shouldpopulate with'Business
Sub-categories' related to the 'BusinessCatego ry' butonce 'Business
Category' is selected I get thejavascript error:
You shouldn't be doing it with JavaScript if you have server-side support.
To do so will make your page needlessly dependent upon JavaScript. It's
also unwise to automatically submit a form when someone changes a value in
a SELECT element. This is because two methods of changing values, by
keyboard and by mouse wheel, result in several change events. Furthermore,
a user can't change their minds or make a correction. Instead they have to
wait for the server response before they can try again. Lastly, if they
stop the submission, but then realise that it was the most appropriate
option, they can't continue because they already have that value selected
and selecting it again won't fire an event. Instead, they have to select a
different option before reselecting[1].
Line: 98
char: 25
error: object doesn't support this property or method
code: 0

Can anyone save us?
Well you can start by using a different browser for debugging and testing
documents. IE is a lowsy browser. Be sure to use a better one like Mozilla
or Opera before deploying a page. Despite being more standard's compliant,
these browsers offer better script error feedback by default (no updates
required).

[snip]
On the 'business_categ ory' I am using

onchange="this. form.ac.value=' delete';this.fo rm.submit()


Actually, you're not. The error Opera shows me is:

http://www.workwise-ely.org/directory/add.php
Event thread: onchange
Error:
name: TypeError
message: Statement on line 1: Expression evaluated to null or
undefined and is not convertible to Object: form.pr
Backtrace:
In unknown script
form.pr.ac.valu e = "pr";
At unknown location
{event handler trampoline}

Searching for that code, I find:

onchange="form. pr.ac.value='pr ';form.pr.submi t()"

By the way, the more standards-compliant way to reference forms and form
controls is through the forms and elements collections:

onchange="this. form.elements['ac'].value='pr';thi s.form.submit() ;"

But, as I said above, you should drop that whole thing anyway.

Now we have that sorted, on to other matters...

Minor points

I'd change the images (Business and Enterprise, and Investors In People)
so that they don't shift down when hovered. It looks like something went
wrong when you altered them.

At the bottom of the page, it states: "This website is compliant in: XHTML
| CSS | WAI-AAA". It isn't valid XHTML, and I couldn't check the CSS
because the mark-up was broken. Don't claim these things if they're
untrue. Also, it should probably read, "This website complies with the
following standards: ...".

Overall, there are seven spelling and grammar mistakes in the "In
Associating With..." section.

The name for electronic messages is "e-mail", not "email".

Technical matters

I don't know why your script expends so much energy on code to open new
windows. New windows are a Bad Thing. Don't use them. Pop-up blockers also
make them unreliable.

Steer clear of Dreamweaver generated JavaScript code. It's nasty. I'd
personally recommend steering clear of Dreamweaver, but that may not be an
option. By the way, I hope nothing ever goes wrong with YY_checkform(). :)

Please learn to use feature detection. Just because a browser supports
document.getEle mentById doesn't mean it supports every W3C-specified
object and method. Similarly, it isn't just IE that provides the
document.all collection. See the group FAQ, specifically section 4.26 and
its links. <URL:http://jibbering.com/faq/>

This goes with the previous point, but it deserves some extra attention.
Your CSS switcher is a bad idea. Not all browsers support the
document.styleS heets collection, thereby rendering the entire function
worthless. Instead, use the intended method of stylesheet switching:
alternate stylesheets. All good browsers will allow the user to switch the
active stylesheet using some built-in method. IE, being a terrible
browser, does not, so your function still serves a purpose in augmenting
that particular browsers failings. Still, it requires feature detection.

Mike
[1] This last case happened to me on another site just 10 minutes ago. So
yes, these things do occur.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail
Jul 23 '05 #4

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

Similar topics

5
7405
by: shank | last post by:
Can anyone give me some general ideas on why an error like Object doesn't support this property or method: 'ZoneRS.MoveFirst' comes up on a page? MoveFirst is a command to move to the first record... correct? thanks
4
13767
by: KathyB | last post by:
I have the following script in an html page: function goToPosition() { varGoTo = document.write(document.cookie("Position")); document.scrollTo(0, varGoTo); } </head> <body onload="goToPosition()">
2
8923
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 onclick="javaScript:alert('document.forms(0)='+document.forms(0)); parent.myFunc(document.forms(0));" type="button" value="Open" name="Button" ID="Button"> The strange part is that the debug alert says that the document.forms(0) is an object så all seem to be well. But...
5
70715
by: den2005 | last post by:
Hi everybody, Problem with dragging effect of resizing is working but having problem with setting a flag to determine if mouse button is click or not. Is there anyone knows how to fixed this? I used several ways to do this as shown below, all telling me the error below. I used IE 6 w/ SP1. The error comes from onmousedown"mousedown()". Error message: Microsoft JScript runtime error: Object doesn't support this property or method
5
550
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 doesn't support this property or method" Yet the Intellisense shows the following-- axMainViewJ1Obj1.AddFileJ1(ref string str);
2
3873
by: Charles | last post by:
I have a validation script used before submitting a form. When executed it says "Object doesn't support property or method". I'm using onclick="return validate();" which should be fine. But when you click "Submit", you get this error: http://www.auriance.com/docs/tmp/nutrinat/pedido_.php Any idea? Thanks,
0
1899
by: chighley | last post by:
I'm using CR 11.5 R2 for VS.NET 2005. I have a CrystalReportViewer on an aspx page. When my report is run, the report comes up in the viewer but if either the export or print button is clicked a script error occurs. "object doesn't support this action" This does not occur on my local machine (with the full Crystal Development version installed). It only occurs on web servers that have the runtime installed. Has anyone seen this or know...
1
3403
by: chetan7991 | last post by:
I'm using a jquery plugin Galleriffic in my page and it shows perfectly in all browsers except IE. The error says: "Object doesn't support this property or method" The code I use for script activation is: <script type="text/javascript"> $(document).ready(function() { var gallery = $('#thumbs').galleriffic({ delay: 3000, // in milliseconds numThumbs: 2, // The number of thumbnails to...
2
7232
by: simeric | last post by:
Hi all experts, I've "object doesn't support this property or method" error when running a Javascript on Internet Explorer 8 This is the statement that is having the error:- this.nodes=(node.obj.draw(0,0,this.getp(node,"width","100%"),0,this.getp(node,"bgcolor",0),0,(1000-this.num),this.getp(node,"div_class",0),s)); } Please kindly advise on this error can be fixed please Thank you very much
0
8707
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
9314
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...
0
7953
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6634
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
5947
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
4464
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...
0
4725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3158
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
2
2520
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.