Forums Forums Search & Filter Pro How to add event on submit button?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #217069

    Hello, I want to add event on submit button.

    After clicking the submit button, screen prompts “please wait” before getting any response.

    Where can I add to this?

    Thanks.

    Trevor
    #217082

    You would need to add some of your own (or third party) javascript to do this, but it is possible. The JavaScript would look something like this:

    (function ( $ ) {
    	
    	"use strict";
    	
    	//detects the start of an ajax request being made
    	$(document).on("sf:ajaxstart", ".searchandfilter", function(){
    	  console.log("ajax start");
    	  //show your loader
    	});
    
    	//detects when the ajax request has finished and the content has been updated
    	// - add scripts that apply to your results here
    	$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    		console.log("ajax complete");
    		//hide your loader
    	});
    
    	
    }(jQuery));

    But you would need to actually add something to this code (and maybe to the page) to actually show and hide.

Viewing 2 posts - 1 through 2 (of 2 total)