Osclass Support Forums

Osclass theme support => Free themes => Topic started by: Gilou26 on October 12, 2019, 03:00:45 PM

Title: Start search without clicking on the magnifying glass
Post by: Gilou26 on October 12, 2019, 03:00:45 PM
Hello.
Is it possible that the search will start automatically as soon as a category has been selected (without having to click on the magnifying glass).
Thank you in advance for your help.

Osclass 3.8.0 / Osclasswizards 2.0.6
Title: Re: Start search without clicking on the magnifying glass
Post by: MB Themes on October 12, 2019, 04:24:02 PM
It's just jquery code that will be binded to category field, you could quickly find it on stackoverflow
Title: Re: Start search without clicking on the magnifying glass
Post by: Gilou26 on October 12, 2019, 05:44:29 PM
Thank you for your answer.
I've never used stackoverflow, I've looked but I'm having trouble doing my research (my English is not very good).
Can you tell me how to find the right jQuery code and what to change on it?
Thank you in advance.
Title: Re: Start search without clicking on the magnifying glass
Post by: MB Themes on October 14, 2019, 09:27:02 AM
@Gilou26
Something like:
Code: [Select]
$(document).ready(function() {
  $('body').on('change', 'select[name="sCategory"]', function(e) {
    $(this).closest('form').submit();
  });
});
Title: Re: Start search without clicking on the magnifying glass
Post by: Gilou26 on October 14, 2019, 06:30:09 PM
Hello.
Great, it works very well.
Thank you very much for your help.
Title: Re: Start search without clicking on the magnifying glass
Post by: MB Themes on October 14, 2019, 09:40:30 PM
Welcome