Listbox and enable submit

I

Intikhab Bashir

Hi,

I want the submit button to be enabled once a user chooses something
from a listbox. How can I do this? Here is what I have done up to
yet and it does not work. Thanks in advance.

The listbox is called lstCorp and submit button is called btnSubmit.

Private Sub lstCorp_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
lstCorp.SelectedIndexChanged
If lstCorp.SelectedIndex > -1 Then
btnSubmit.Enabled = True
End If
End Sub

HTML:

<asp:listbox id="lstCorp" DataTextField="proc_corp" Runat="server"
SelectionMode="Multiple"></asp:listbox>
<p></p>
<asp:button id="btnSubmit" runat="server" Text="Submit"
Enabled="true"></asp:button>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top