I have tried numerous ways to do this without much luck including the function above, a standard jquery function and functions (init & ajax finish) on ajax finish load (as per Q1 here – https://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/).
Ideally I’d love to just set one of the dropdown options as the selected value (either when the page loads or when the other dropdown is clicked – this one I’m setting it on is hidden).
More than happy to do it via $(“select option[value=’test’]”).attr(“selected”,”selected”);
I just need to get that working in a place it executes on the page!
The page with the form is a single-taxonomy.php and has 2 taxonomy dropdown on it (one that the user sees and one that’s hidden that I’d like to set the taxonomy term on). This all works correctly if both dropdown are visible and the user selects the term – so it’s just figuring out how to set the term on the hidden dropdown when the page loads or when the user clicks on the available taxonomy dropdown to them (i’ve tried an on change event without luck).