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
  • 20,857
  • 9
  • 45
  • 61
Ranjith
  • 531
  • 3
  • 10
  • 20

3 Answers3

3

I solved the problem.

$("#[id$=StatusField ]").multiselect("uncheckAll");
Ranjith
  • 531
  • 3
  • 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
  • 9,921
  • 23
  • 74
  • 141
0

Since it's a dropdown can you try:

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