• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Object does not support property error!

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks,



 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
document.getElementById("elementID")

Eric

 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Eric Pascarello wrote:document.forms[0].elementName

This is not specific enough, I wouldn't use it.
 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
    Bookmark Topic Watch Topic
  • New Topic