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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdownlist and button

Status
Not open for further replies.

sroberts82

Programmer
Oct 11, 2005
36
US
Hi,
I have a form with a dropdownlist on it. I have an eventhandler for OnSelectedIndexChanged which works grand. The problem arises when I try to add a submit button. Form appears fine first time, but when I attempt to change the selected item in dropdownlist, and error comes about saying there is a problem with some JScript error (I imagine added itself I didnt have any Jscript in) saying

function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit(); <-----"object doesnt support this property or method"
}
}

any ideas? Thanks in advance,
Ste
 
Paste both the HTML and code for the Button and DropDownList


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Dropdown list:

<asp:TableRow>
<asp:TableCell><asp:DropDownList ID="gameGroup" runat="server" Width="204px" OnSelectedIndexChanged="gameGroupSelectionChange" AutoPostBack="true"></asp:DropDownList></asp:TableCell>
</asp:TableRow>

protected void gameGroupSelectionChange(Object sender, EventArgs e)
{
DropDownList list = (DropDownList)sender;
Session["SelectedIndex"] = new gameGroup(list.Items[list.SelectedIndex].Text, System.Convert.ToInt32(list.Items[list.SelectedIndex].Value), list.SelectedIndex);
Response.Redirect("gamesUploadForm.aspx");

}


Button:
<asp:Button runat="server" ID="submit" Text="Submit" OnClick="submitClick" />


submit code is empty at moment, want to fix this error first
 
I think the problem is that when the submit button posts back its all fine, the this.submit() means something, but when the dropdownlist posts back it doesnt understand the this.submit. But how to get around it?
 
The javascript you see is generated by ASP.NET and is used to submit the form. If it is erroring you may have a problem with your installation. Does this happen in all browsers (or just IE)?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top