You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to apply it to every select element, and they're all basic dropdowns/selects (no search, etc) you can get every element and iterate over them like this:
const e = document.getElementsByTagName("select");
for (var i = 0; i < e.length; i++) {
NiceSelect.bind(e[i]);
}
I have one select that's slightly different, so I just added a condition within it.
function updateSelectFields() {
const e = document.getElementsByTagName("select");
for (var i = 0; i < e.length; i++) {
if ( e[i].classList.contains('searchable') ) {
NiceSelect.bind(e[i], {searchable: true, placeholder: 'Search'});
} else {
NiceSelect.bind(e[i]);
}
}
}
How to apply for 2 or more selects in a form like state and city?
The text was updated successfully, but these errors were encountered: