[CLOSED]limit number of selected items on combo Box
Hi all, I have a combo box that holds a long list of names. May I know how can limit the number of items selected on a Combo Box in Web Focus.
Thanks!!!This message has been edited. Last edited by: <Emily McAllister>,
WebFOCUS 8 Windows, All Outputs
August 11, 2016, 01:23 PM
Squatch
Assuming your combobox has unique identifier "combobox1", and you want no more than 3 selections, update your window_onload function like so:
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
$('#combobox1').on('change', function() {
var $sel = $(this).find(':selected');
if ($sel.length < 4) {
$sel.addClass('selected');
$(this).find(':not(:selected)').removeClass('selected');
} else
$(this).find(':selected:not(.selected)').prop('selected', false);
});
}