postback javascript error

James

Well-known member
Joined
Oct 3, 2002
Messages
78
Whenever my form postback from a dropdown control I get a javascript error stating, "Object doesnt support this property or method." I think this happens on theform.submit(); line below. Does anyone know how I can fix this problem?

function __doPostBack(eventTarget, eventArgument) {
var theform = document.Form1;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}

Thanks,

James
 
What browser are you using? If your form is indeed called Form1, which I assume it is if the __EVENT things are set property, that line should certainly work.
 
I have IsPostBack in my code. Also, the reason why I am using doPostBack is because I have a dropdown control that has AutoPostBack="true" and the dropdown calls a VB sub procedure. In order for my dropdown to work I thought I was suppose to add AutoPostBack="true". The AutoPostBack adds a doPostBack function automatically. Any thoughts?

James
 
I found my problem. I have a button control with the id="submit". For some reason the postback doesnt like buttons with the id="submit." If anyone know why please let me know.

James
 
Since the button is named submit, calling theform.submit() in the
JS you pasted refers to that control instead of the submit method
of the form like it is supposed to.
 
Back
Top