473,468 Members | 1,472 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

object does not support this property or method 2146827850

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 method 2146827850'
Does any one know why this problem occurs?

Apr 25 '06 #1
7 29727
st*********@gmail.com said on 25/04/2006 10:13 PM AEST:
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,
What is 'the default javascript function'?

the error message 'object does not support this
property or method 2146827850'
Does any one know why this problem occurs?


Typically because you are attempting to use a method or property with an
object that doesn't support the method or property. Post a minimal
example that demonstrates the behaviour, then you'll get a more useful
response - maybe. ;-)
--
Rob
Group FAQ: <URL:http://www.jibbering.com/FAQ>
Apr 25 '06 #2
RobG wrote:
st*********@gmail.com said on 25/04/2006 10:13 PM AEST:
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,

What is 'the default javascript function'?

the error message 'object does not support this
property or method 2146827850'
Does any one know why this problem occurs?

Typically because you are attempting to use a method or property with an
object that doesn't support the method or property. Post a minimal
example that demonstrates the behaviour, then you'll get a more useful
response - maybe. ;-)

Or load the page in FireFox and get a more meaningful error message...

--
Ian Collins.
Apr 25 '06 #3
Ian Collins wrote:
RobG wrote:
st*********@gmail.com said on 25/04/2006 10:13 PM AEST: <snip>
the error message 'object does not support this
property or method 2146827850'
Does any one know why this problem occurs?

Typically because you are attempting to use a method or property
with an object that doesn't support the method or property. Post a
minimal example that demonstrates the behaviour, then you'll get a
more useful response - maybe. ;-)

Or load the page in FireFox and get a more meaningful error
message...


It is often repeated that IE's error messages are a bit too obscure (and
constantly getting the line numbers off doesn't help much) but it is
maybe a little unfair as IE is at least consistent and once you are used
to its errors you can know what to look for when a particular error
appears.

For example, when IE complains "Object expected" it invariable means
that an attempt was made to call a function with an Identifier that
evaluated as Undefined or Null. That is a compliantly reasonable error
to generate as only functions can be called and functions are a sub-set
of objects so when JScript discovers that a value is not a reference to
an object there is no need to go on to worry about whether that objet
has a [[Call]] method, it can stop at the realisation that the value is
not an object, and announce that.

Granted, JavaScript(tm)'s "'something' is not a function" is more
obvious, but you cannot debug IE specific script issues by trying code
that will take an entirely different branch in an alternative browser.
So learning to match IE's obscure messages with their causes is still a
good idea.

Richard.
Apr 26 '06 #4
Richard Cornford wrote:
Ian Collins wrote:
RobG wrote:
st*********@gmail.com said on 25/04/2006 10:13 PM AEST:
<snip>
the error message 'object does not support this
property or method 2146827850'
Does any one know why this problem occurs?
Typically because you are attempting to use a method or property
with an object that doesn't support the method or property. Post a
minimal example that demonstrates the behaviour, then you'll get a
more useful response - maybe. ;-)


Or load the page in FireFox and get a more meaningful error
message...

It is often repeated that IE's error messages are a bit too obscure (and
constantly getting the line numbers off doesn't help much) but it is
maybe a little unfair as IE is at least consistent and once you are used
to its errors you can know what to look for when a particular error
appears.

I agree, but having another tool in the box helps. I assumed the OP was
a novice and hadn't mastered the art of interpreting IE's error messages.

--
Ian Collins.
Apr 26 '06 #5
hi all,
as the question was not clear to all, i am posting the question once
again.

I have a HTML page with two forms.
While trying to add a hidden element in a first form by the default
javascript functions, like createElemet & appendchild.

function addField (form, fieldType, fieldName)
{
if (!document.createElement) return;
var oInput = document.createElement('input');
oInput.type = fieldType;
oInput.name = fieldName;
form.appendChild (oInput);
}

the error message 'object does not support this
property or method' with the error number 2146827850 was displayed
when the code was put inside a
try...catch...
Does any one know why this problem occurs?

Apr 27 '06 #6
VK

st*********@gmail.com wrote:
hi all,
as the question was not clear to all, i am posting the question once
again.

I have a HTML page with two forms.
While trying to add a hidden element in a first form by the default
javascript functions, like createElemet & appendchild.

function addField (form, fieldType, fieldName)
{
if (!document.createElement) return;
var oInput = document.createElement('input');
oInput.type = fieldType;
oInput.name = fieldName;
form.appendChild (oInput);
}

the error message 'object does not support this
property or method' with the error number 2146827850 was displayed
when the code was put inside a
try...catch...
Does any one know why this problem occurs?


Difficult to say without seeing the page or at least the function call
(what are you feeding to addField). Just out of wild: are you sure that
you're sending form reference and not a string with form name?

Apr 27 '06 #7
st*********@gmail.com wrote:
hi all,
as the question was not clear to all, i am posting the question once
again.

I have a HTML page with two forms.
While trying to add a hidden element in a first form by the default
javascript functions, like createElemet & appendchild.

function addField (form, fieldType, fieldName)
{
if (!document.createElement) return;
var oInput = document.createElement('input');
oInput.type = fieldType;
oInput.name = fieldName;
form.appendChild (oInput);
}

the error message 'object does not support this
property or method' with the error number 2146827850 was displayed
when the code was put inside a
try...catch...
Does any one know why this problem occurs?

As I said, try FF, you will get the object name and line number in the
JavaScript console.

Is form a valid HTMLFormElement object?

--
Ian Collins.
Apr 27 '06 #8

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

Similar topics

18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
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 = " +...
6
by: Luke | last post by:
Here is my emails to Danny Goodman (but probably he is very busy so he didn't answered it). First email(simple): Subject: JavaScript Arrays " We all know the array can act like HashMap, but is...
12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
7
by: Martin Robins | last post by:
I am currently looking to be able to read information from Active Directory into a data warehouse using a C# solution. I have been able to access the active directory, and I have been able to return...
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...
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...
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
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,...
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
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...
0
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.