document.addEventListener('DOMContentLoaded', function() {
const resetButton = document.getElementById('resetButton');
const multiSelects = document.querySelectorAll('.form-multi-select');
resetButton.addEventListener('click', function() {
// Loop through each multi-select and reset its value
multiSelects.forEach(select => {
// Deselect all options
for (let i = 0; i < select.options.length; i++) {
select.options[i].selected = false; //Deselect
}
const coreUISelect = select.CoreUISelect; // Access the CoreUI instance
if (coreUISelect) {
coreUISelect.setValue([]); // Clear selected values using CoreUI API
}
// Update the placeholder (first disabled option)
select.selectedIndex = 0; // Resets to the first option which is disabled
});
// Optionally reset the date fields
document.getElementById('date-from').value = '';
document.getElementById('date-to').value = '';
});
});
Sales Director
Jayson Cheves
Ahmed Mohamed
Rajesh Sankaran
Ashley Philips
RSM's
Karim Dhanani
Anayeli Valle
Joel Ramirez
DSM's
Karim Dhanani
Anayeli Valle
Joel Ramirez
Locations
10th Street
13th Street
1st Street
28th Street
Search
Reset
Export
resetButton.addEventListener('click', function() { // Loop through each multi-select and reset its value
multiSelects.forEach(select => {
// Deselect all options for (let i = 0; i < select.options.length; i++) { select.options[i].selected = false; //Deselect }
const coreUISelect = select.CoreUISelect; // Access the CoreUI instance if (coreUISelect) { coreUISelect.setValue([]); // Clear selected values using CoreUI API } // Update the placeholder (first disabled option) select.selectedIndex = 0; // Resets to the first option which is disabled });
// Optionally reset the date fields document.getElementById('date-from').value = ''; document.getElementById('date-to').value = ''; }); });[/code] [code]
Sales Director Jayson Cheves Ahmed Mohamed Rajesh Sankaran Ashley Philips
RSM's Karim Dhanani Anayeli Valle Joel Ramirez
DSM's Karim Dhanani Anayeli Valle Joel Ramirez
Locations 10th Street 13th Street 1st Street 28th Street