YiiBooster
YiiBooster copied to clipboard
Reset button does not reset Select2 fields
Within a form a
This piece of code solves the problem:
$("form button[type=reset]").on("click",function(){
if (form = $(this).closest("form")) {
$(".select2-container",form).select2("data", null);
}
});