469,352 Members | 2,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

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 29388
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Martin Robins | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.