Tell us what you are trying to do?
In Real Estate Reference Site, I want to prevent 'Advance Search' from toggles close after update values (eg. select dropdown State > City). Even if View's custom search setting was set to: Full page refresh when visitors click on the search button, Advance Search toggles close when select State, and City list being populated.
The Advance search should still collapsing open, until after Button Search is clicked / or AJAX refresh.
Is there any documentation that you are following?
Couldn't find any.
Is there a similar example that we can see?
What is the link to your site?
It's a localhost development.
Hi,
Thank you for contacting us and I'd be happy to assist.
In a view named "Search - House" that controls the search form on the homepage, you'll find some script in the "JS editor" tab
under the "Search and Pagination".
To keep the advanced search container open, when the search form fields are changed, you can update that code to:
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
searchToggleBody();
if (jQuery("body.search-open")[0]){
jQuery('#searchMore').addClass("show");
}
if(jQuery('#searchMore').find('input[type="checkbox"]:checked').length > 0) {
jQuery('#searchMore').addClass("show");
}
});
jQuery( document ).ready(function() {
searchToggleBody();
});
function searchToggleBody() {
jQuery( "a[aria-controls='searchMore']" ).click(function() {
jQuery('body').toggleClass("search-open");
});
}
I hope this helps and for more personalized assistance around custom code, you can hire a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar
It works great! Thank you so much Waqar!