I'm using the JQuery multiselect plugin from: link .
$(document).ready(function(){
Well, I'm using the function below that checks the marked options
for (i = 0; i < $(".ui-multiselect-checkboxes").length; i++) {
$ui = $(".ui-multiselect-checkboxes");
$indiferente = $ui.find("[title=Indiferente]");
$indiferente.prop("checked", true);
$ui.find("input").change(function(){
if($(this).attr("title") != "Indiferente" && this.checked){
$indiferente.prop("checked", false); //desmarco indiferente se algum
//outro for selecionado
}
if(!$ui.find("input:checked").length){ //se nenhum input estiver marcado
$indiferente.prop("checked",true); //marco indiferente
}
})
$indiferente.change(function(){ //quando indiferente mudar
if(this.checked){ //se estiver marcado
$ui.find("input").not("[title=Indiferente]").prop("checked", false);
//desmarco outros
}
})
$("#ui-multiselect-tipo-option-0").click();
$("#ui-multiselect-bairro-option-0").click();
}
Obviously I hit the plugin to select fields
$("#tipo").multiselect();
$("#bairro").multiselect();
But the part of the markings stopped working
});
Where did I go wrong?