Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Object does not support this property or method : ERROR -- JAVA SCRIPT

843836Mar 31 2005 — edited May 14 2008
Hi,

whenever Iam changing a value in the drop down box I want to reload my form. So Iam calling the function in the onChange event of my drop down box. But the form is not submitted, it shows Object does not support this property or method as an error.
The code for this placed below..
<html>
<head>
<script language="javascript">

function formSubmit() 
{
document.forms[0].submit();       //or document.regform.submit();
}

</script> 
</head>
<body>

<form method="post" name="regform" action=updatetechinter.jsp>

<select size="1" name="D1" onChange=formSubmit()>
.
.<option>....</option>
.
.
.
</select>
</form>
</body>
</html>

Comments

843836
Hi,
I too get the same problem sometimes..
Dont know wat is the reason..
gimbal2
Try running it in Firefox and checking the javascript console when this happens. IE has completely sh1tty error reporting. I'm guessing that your HTML source contains a syntax error that is confusing the browser, or you are using a reserved keyword somewhere in your code. Difficult to say with so little code.
843836
In fire fox the error which I got is
Error: document.regform.submit is not a function
using
document.forms[0].submit
also give similar error
I think I havnt use any keywords..

The variables and names given in the sample are exactly same as in my code.
gimbal2
This is most definately the result of bad formatting which is screwing up the DOM that the browser is creating. Run your html output through a validator to see if that turns something up (check http://www.w3.org website).
843836
Hi,
Ur code seems to be perfect...but as long as ur getting error...u need to find out other ways to write the same code......in this way it might work....
I would suggest u to try the following code....and hope that it will work...

**********************************************************************
<html>
<head>
<script language="javascript">

function formSubmit()
{
document.regform.action = "updatetechinter.jsp";
document.regform.method = "post" ;
document.regform.submit();
}

</script>
</head>
<body>

<form name="regform" >

<select name="D1" onChange="javascript:formSubmit();">
.
.<option>....</option>
.
.
.
</select>
</form>
</body>
</html>




********************************************************************

Thanks,
Raj(Anurag)
843838
hi,
make sure that the user defined controls name(like input, buttons, hidden fields... etc) should not affect the method names or property..

E.g

<input type=hidden name="submit" value="formSubmit">

The aboue code, i.e creating an input field of hidden type named as "Submit" , which affects the javascript Submit method.
843840
Whenever I try thro'IE i get amessage OBJEC doesn't support this property or method
843840
You may try to see if you have declare a variable called "submit". If you do change it to something else then you will not be getting the error messages.
843840
thanks E_J, that really did work for me... spent almost half a day trying to find a solution
843840
Thanks, it did worked for me really..saved me a lot of time ...
1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 11 2008
Added on Mar 31 2005
10 comments
189 views