Do you know how to properly reduce this code?

Do you know how to properly reduce this code?

I have this code to submit the form with name="search" on the change events of any of this select menus: categories, price, and range). The code is working but it doesn't seem very correct because it has some repetition. Do you know how to properly reduce the code?


  1. $(document).ready(function() {
  2.   $('select[name="categories"]').on('change', function() {
  3.     $('form[name="search"]').submit(); 
  4.   });
  5.     $('select[name="price"]').on('change', function() {
  6.     $('form[name="search"]').submit(); 
  7.   });
  8.     $('select[name="range"]').on('change', function() {
  9.     $('form[name="search"]').submit(); 
  10.   });
  11. });