Skip Navigation

[Resolved] Real Estate Reference Site: Prevent Advance Search toggle close after update

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by saravanC 5 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1595833

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.

#1596741

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

#1597611

It works great! Thank you so much Waqar!