Question about deselect option #1275
Replies: 4 comments 5 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the answer ! This code onChange:function (option, checked) {
if(option.val() == 'memo' && checked == true){
$('#select-dests').multiselect('deselectAll');
}
}, Uncheck all checkboxes when "memo" is checked, it's parefect. |
Beta Was this translation helpful? Give feedback.
-
I suspect you're after something like this (untested): onChange:function (option, checked) {
if(option.val() == 'memo' && checked == true){
console.log(option.val() + " " + checked);
$('#select-dests option:not([value="memo"])').prop({ selected: false, disabled: true });
$('#select-dests').multiselect('refresh');
}
else {
$('#select-dests option').prop({ disabled: false });
$('#select-dests').multiselect('refresh');
}
}, This will un-select and disable all options in this select which do not have the value "memo". Since we're manipulating the actual
I added the Please note that none of this is tested, but I've done similar things in the past, so with some tweaks on your end it should work. |
Beta Was this translation helpful? Give feedback.
-
Hi and many thanks, it's exactly what I wanted to do. Perfect ! |
Beta Was this translation helpful? Give feedback.
-
Hi and thanks for this nice plugin.
I would like to unselect all options if a specific one is selected.
Is it possible ?
I did that but it's not working (just tried to deselect an option for test)
Could you help me ?
Best regards.
Renaud.
Beta Was this translation helpful? Give feedback.
All reactions