1document.addEventListener("DOMContentLoaded", function () { 2 const form = document.getElementById('advanced-movie-search-cta'); 3 4 if(form) { 5 const multiselects = form.querySelectorAll("select[multiple]"); 6 7 form.addEventListener("submit", function (event) { 8 multiselects.forEach(select => { 9 const selectedOptions = Array.from(select.selectedOptions).map(option => option.value); 10 if (selectedOptions.length > 0) { 11 // Remove existing hidden inputs for the same name to avoid duplicates 12 const existingInputs = form.querySelectorAll(`input[name="${select.name}"]`); 13 existingInputs.forEach(input => input.remove()); 14 15 const hiddenInput = document.createElement("input"); 16 hiddenInput.type = "hidden"; 17 hiddenInput.name = select.name; 18 hiddenInput.value = selectedOptions.join(","); 19 form.appendChild(hiddenInput); 20 21 select.disabled = true; 22 } 23 }); 24 }); 25 } 26});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.