| Author |
Oject Does Not Support This Property Or Method
|
Ayan Biswas
Ranch Hand
Joined: Jul 10, 2010
Posts: 95
|
|
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?
|
AyanBiswas
|
 |
Nikhil Padharia
Ranch Hand
Joined: Apr 19, 2012
Posts: 37
|
|
Do you have two forms on your JSP?
If no then you will need to use
instead of
|
 |
Ayan Biswas
Ranch Hand
Joined: Jul 10, 2010
Posts: 95
|
|
|
@Nikhil Padharia ,yes I have 2 forms in my jsp page
|
 |
Nikhil Padharia
Ranch Hand
Joined: Apr 19, 2012
Posts: 37
|
|
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
Joined: Jul 10, 2010
Posts: 95
|
|
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
Joined: Apr 19, 2012
Posts: 37
|
|
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
Joined: Jul 10, 2010
Posts: 95
|
|
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
Joined: Apr 19, 2012
Posts: 37
|
|
|
and what does document.forms[1].action gives you?
|
 |
Ayan Biswas
Ranch Hand
Joined: Jul 10, 2010
Posts: 95
|
|
Nikhil Padharia
and what does document.forms[1].action gives you?
alert(document.forms[1].action==null) gives false;
|
 |
Nikhil Padharia
Ranch Hand
Joined: Apr 19, 2012
Posts: 37
|
|
|
All this tests you are performing using the same submit button click?
|
 |
Ayan Biswas
Ranch Hand
Joined: Jul 10, 2010
Posts: 95
|
|
Nikhil Padharia
All this tests you are performing using the same submit button click?
Yes
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Do you have an element on your page named action or submit? [textbox, btn, etc?]
If you do rename it.
Eric
|
 |
 |
|
|
subject: Oject Does Not Support This Property Or Method
|
|
|