- This topic has 13 replies, 2 voices, and was last updated 5 years, 4 months ago by .
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Looks like Submit button isn’t working because of delay
Tagged: loading, Search and filter form, submit button
Just one more question: I work with multiple forms. I know how to add the css rules but am not sure how to add those to the script. Just like this?
<script>(function ( $ ) {
“use strict”;
$(document).on(“sf:ajaxformstart”, “.searchandfilter”, function(){
$(‘.searchandfilter[data-sf-form-id=”10574″, data-sf-form-id=”13928″] li.sf-field-submit input’).addClass(‘disabled’);
});
$(document).on(“sf:ajaxformfinish”, “.searchandfilter”, function(){
$(‘.searchandfilter[data-sf-form-id=”10574″, data-sf-form-id=”13928″] li.sf-field-submit input’).removeClass(‘disabled’);
});
}(jQuery));</script>
You could simplify the code is you want it on all forms:
<script>(function ( $ ) {
"use strict";
$(document).on("sf:ajaxformstart", ".searchandfilter", function(){
$('.searchandfilter li.sf-field-submit input').addClass('disabled');
});
$(document).on("sf:ajaxformfinish", ".searchandfilter", function(){
$('.searchandfilter li.sf-field-submit input').removeClass('disabled');
});
}(jQuery));</script>
I think that might work. They are not on the same page, are they?
If this works, is it OK to close this thread?