Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dropdown list error

Status
Not open for further replies.

stephen2005

Programmer
Feb 13, 2005
53
IE
any ideas why this error would occur when an auto
postback event is triggered from dropdown list?

"Microsoft JScript runtime error: Object doesn't support this property
or method"

<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit(); <---------------ERROR Occurs here
}
}
// -->
</script>
 
stephen: Post this problem over at the Javascript forum; you'll probably get an answer in short order.
 
>>Object doesn't support this property or method"

check if u have any control with the name / id as "submit". if it is there then remove it...

Known is handfull, Unknown is worldfull
 
vbkris - usually the submit line (from what I recall of javascript) goes something like:

window.opener.document.forms["Form1"].submit();

and similar statements - however, the guys over at the Javascript forum would make short work of this (probably a matter of minutes).
 
Hi guys, thanks a lot for your help. It turns out had foolishly given another button control on the page the ID of 'submit'
 
>>Hi guys, thanks a lot for your help. It turns out had foolishly given another button control on the page the ID of 'submit'

bingo. thats one of the first errors i faced with JS.

Known is handfull, Unknown is worldfull
 
And don't forget javascript is "case" sensitive; that one will sneak up behind you as well -- cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top