File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Object does not support property error! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Object does not support property error!" Watch "Object does not support property error!" New topic

Object does not support property error!

Natalie Ap
Ranch Hand

Joined: Jan 09, 2009
Posts: 49
Hi all,

I am trying to run the following piece of code, but I am getting a javascript error "Object does not support property error!" and I am unable to understand what the problem might be.

There is a form called "updateForm" which I am trying to submit when i get the error. When I comment lines (1), (2), (3), the error does not get thrown. Please help me!!

Please let me know if you need any other information besides this.


Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Well first problem is document.all is IE only.

You should be using document.formName.elementName or
You should be using document.forms["elementName"] or
You should be using document.forms[0].elementName or


Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Eric Pascarello wrote:document.forms[0].elementName
This is not specific enough, I wouldn't use it.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62746

I agree. The [0] notation is rather old-fashioned and is fragile. Avoid it.

id values allows you to specifically target an item without ambiguity.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Object does not support property error!