Skip Navigation

[Résolu] Prevent Search from being triggered

This support ticket is created Il y a 7 années et 3 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 16 réponses, a 2 voix.

Dernière mise à jour par Luo Yang Il y a 7 années et 2 mois.

Assisté par: Luo Yang.

Auteur
Publications
#567426

Still doesn't seam to trigger, if you look here lien caché 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:
lien caché
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