Saturday, March 23, 2013

Remove DropDownList value on select change

Consider the below dropdown list.

<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Select Below</asp:ListItem>

Lets say we need to remove the item at 0th index when user selects an item from the list.

Jquery Script:
<script src=""></script>
<script type="text/javascript"> 
 $(document).ready(function () { 

 $("#<#= DropDownList1.ClientID #>").change(function () {

 $("#<#= DropDownList1.ClientID #> option[value='0']").remove();



No comments:
Write comments
Recommended Posts × +