Skip Navigation

[Resolved] Prevent Search from being triggered

This support ticket is created 7 years, 3 months 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/Hong_Kong (GMT+08:00)

This topic contains 16 replies, has 2 voices.

Last updated by Luo Yang 7 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#567426

Still doesn't seam to trigger, if you look here hidden link and do a search you dont get an alert but if you hit reset it triggers. The alert is simple wrapped like so

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
	alert('Only Triggered on Reset?');
});
#568361

Sorry for the delay answer, I was on a trip.

I checked it again in your website, here are detail steps I tried:
1) Modify the JS codes as below:

jQuery(document).on('click', 'button.my-submit-trigger', function(e){
  
  
    var inc = 0;
    jQuery('[name="wpv-payment"]').each(function () {
      if (jQuery(this).is(':checked')) inc++;
    });
  
    if (inc == 0) {
      alert('Please Choose a payment type');
      //e.preventDefault();
      return false;
    }
  
   jQuery('input.wpv-submit-trigger').click();
    e.preventDefault();
  
  }); 



jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
	alert('Only Triggered on Reset?');
});

2) In the front-end:
hidden link
Tried these:
1) click button "Submit", I see the message "Please Choose a payment type"
2) "Payments" choose option "Private", click button "Submit", I see the message "Only Triggered on Reset?", please check if it is what you want. thanks