How to clear selection fields

I hope this is a simple answer, I used the selected drop-down lists to filter the entries. I added another button to restart the filter values.

I want to delete the selected snapshot on "Reset".

I tried changing the selected values, but no luck.

Any pointers?

0
jquery-chosen
Jan 17 '14 at 16:38
source share
3 answers

I finally got the answer to my question, it was asked in the GitHub for Choosen plugin .

Here is the code that works like a charm: -

$('.dropdownclass option:selected').removeAttr('selected'); $('.dropdownclass').trigger('chosen:updated'); 

Hope this helps.

+2
Feb 07 '14 at 19:50
source share

Your reply:

 $(".category-filter").val("") 

Should work if it received the class "category filter" class and is attached to the .click () function and inside the document.ready function. - Is the value of the "" option really a selection option that can be selected? How do I think it takes work?

Violin to show ..

http://jsfiddle.net/UmV6p/3/

0
Jan 17 '14 at 16:51
source share

You will need to reset it first and then update dynamically.

 $(".category-filter").val(""); $(".category-filter").trigger("chosen:updated"); //version v1.0.0 $(".category-filter").trigger("chzn:updated"); //other than version v1.0.0 

Hope this helps.

0
Jan 21 '14 at 15:55
source share



All Articles