I have a form that has 2 dropdownlists. If the person selects a value in the
1st dropdownlist, it must disable the second dropdown list.
This only works if I include the AutoPostBack = "True" in the first drop
down list, but this reloads the page.
Shouldn't this web control automatically be disabled using JavaScript so the
page doesn't have to get another request from the server? I am using IE6 so
it should definately be using uplevel-browser rendering.
Here is the code for you to test...
<script language = "vb" runat = "server">
Sub setSoftwareIntegratesBox(Sender as Object, E as EventArgs)
SoftwareIntegrates.Enabled = 0
myLabel.Text = "Has been disabled"
End Sub
</script>
<html>
<body>
<form runat = "server">
<asp:dropdownlist id = "CurrentlyUseSoftware" runat = "server"
onSelectedIndexChanged = "setSoftwareIntegratesBox">
<asp:listitem Value = "0" Text = "Please select" />
<asp:listitem Value = "1" Text = "Yes" />
<asp:listitem Value = "0" Text = "No" />
</asp:dropdownlist>
<asp:dropdownlist id = "SoftwareIntegrates" runat = "server">
<asp:listitem Value = "0" Text = "Please select" />
<asp:listitem Value = "1" Text = "Yes" />
<asp:listitem Value = "0" Text = "No" />
</asp:dropdownlist>
<asp:label id = "myLabel" runat = "server" />
</form>
</body>
</html>