I have a list box which is in Multiple selection mode but on a particular radio button click i want to change it as Single selection mode. Please help me out
<tr>
<td style="text-align: right; vertical-align: top; width: 21%;">
<asp:Label ID="Label4" runat="server" Text="Do ypu want to apply NET/SET/PH.D. rule" ></asp:Label>
</td>
<td align="left" style="vertical-align: top;">
:
</td>
<td align="left">
<asp:RadioButtonList ID="RB_applyRule" runat="server" RepeatDirection="Horizontal"
onclick="radioButtonClick();"
onselectedindexchanged="RadioButtonList1_SelectedIndexChanged" >
<asp:ListItem Text="Yes       " Value="0" Selected="True" ></asp:ListItem>
<asp:ListItem Text="No" Value="1" ></asp:ListItem>
</asp:RadioButtonList>
<font class="Mandatory">*</font>
</td>
</tr>
<tr>
<td style="text-align: right; vertical-align: top; width: 21%;">
<asp:Label ID="lblDesignation" runat="server" Text="Seniority for designation" meta:resourcekey="lblDesignationResource1"></asp:Label>
</td>
<td align="left" style="vertical-align: top;">
:
</td>
<td align="left">
<asp:ListBox ID="List_Designation" runat="server" Width="306px" SelectionMode="Multiple"
Rows="1"></asp:ListBox>
<font class="Mandatory">*</font>
</td>
</tr>
<tr>
// Javascript
function radioButtonClick() {
var rbList = document.getElementById('<%=RB_applyRule.ClientID%>');
var rbCount = rbList.getElementsByTagName("input");
var targRB;
for (var i = 0; i < rbCount.length; i++) {
if (rbCount[i].checked == true) {
// var labelArray = rbCount[i].parentNode.getElementsByTagName('label');
// targlist = targlist + labelArray[0].innerHTML + ", "; // Get Label of Radiobutton
targRB = rbCount[i].value;
// alert(targRB);
}
}
if (targRB == "0") {
alert("Yes");
}
if (targRB == "1") {
alert("No");
}
}
// When alert says yes means i select yes than designation id List_Designation will be change in select mode.