0

I have multiselect list box, I want to clear all selected items On clear button click.

<asp:ListBox id="StatusField" runat="server" SelectionMode="Multiple" Rows="4" />

I tried as follows.

 $("#StatusField option:selected").removeAttr("selected"); 
Colin Brock
  • 21,267
  • 9
  • 46
  • 61
Ranjith
  • 549
  • 4
  • 10
  • 20

3 Answers3

3

I solved the problem.

$("#[id$=StatusField ]").multiselect("uncheckAll");
Ranjith
  • 549
  • 4
  • 10
  • 20
0

Seeing as how your code is for a dropdown and not a select box, you can try:

$('#StatusField :selected').attr('selected', '');
MultiDev
  • 10,389
  • 24
  • 81
  • 148
0

Since it's a dropdown can you try:

 $("#StatusField").val(""); 
David Cheung
  • 848
  • 4
  • 8