Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oject Does Not Support This Property Or Method

 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used the following javascript function to submit a form in the jsp page

But whenever I click the submit button I get the following error 'Oject Does Not Support This Property Or Method'.The error is in the following line
I am using IE.How would I get rid of this problem?
 
Nikhil Padharia
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have two forms on your JSP?
If no then you will need to use

instead of
 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Nikhil Padharia ,yes I have 2 forms in my jsp page
 
Nikhil Padharia
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try debugging what value of document or document.forms[1] you are getting.
Probably one of them is null, which is creating the problem.
 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nikhil Padharia
Try debugging what value of document or document.forms[1] you are getting.
Probably one of them is null, which is creating the problem.

No,none of them is null
 
Nikhil Padharia
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ayan Biswas wrote:No,none of them is null

Are you sure?
If that is not the case then I don't think there is any reason you get this error.
What values you get for document and document.forms[1]?
 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nikhil Padharia

Are you sure?
If that is not the case then I don't think there is any reason you get this error.
What values you get for document and document.forms[1]?

alert(document) gave [object]
alert(document.forms[1]) gave [object]
alert(document.forms[1]== null ) gave false
alert(document.forms.length); gave 2
 
Nikhil Padharia
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and what does document.forms[1].action gives you?
 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nikhil Padharia
and what does document.forms[1].action gives you?

alert(document.forms[1].action==null) gives false;
 
Nikhil Padharia
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All this tests you are performing using the same submit button click?
 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nikhil Padharia
All this tests you are performing using the same submit button click?

Yes
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have an element on your page named action or submit? [textbox, btn, etc?]

If you do rename it.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic