title: How to combine two jQuery functions into one?
body: <p>I've following two functions in jQuery:</p>
  
  <pre><code>$(document).on('change','.states',function(){ 
    //on change of select 
  });
  
  $(document).on('click','.date_control',function(){ 
   //on click of input .date_control 
  });
  </code></pre>
  
  <p>How to combine the above two functions into one function so that I can use it with my AJAX function which is as below:</p>
  
  <pre><code>$(function() {
    $(".add_new_rebate").on("click", function(event) {
      event.preventDefault();
      var manufacturer_id =  $("#company_id").val();
  
      /*if($.active &gt; 0) { //or $.active      
        request_inprogress();
      } else {*/  
        var next_rebate_no = $('.rebate_block').length + 1;
        var rebate_no      = $('.rebate_block').length + 1;
  
      if ($('.rebate_block').length&gt;0) { 
        rebate_no = rebate_no+1;
      }
  
        $('.add_new_rebate').attr('disabled','disabled');
      //}
  
      $.ajax({
        type: "POST",
        url: "add_rebate_by_product.php",
        data: {'request_type':'ajax', 'op':'create_rebate', 'next_rebate_no':next_rebate_no, 'rebate_no':rebate_no, 'manufacturer_id':manufacturer_id},  
        beforeSend: function() { 
          $('.table-responsive').after("&lt;img src='http://localhost/smart-rebate-web/web/img/ajax-loader.gif' class='load' alt='Loading...'&gt;");
        },
        success: function(data) {
          if(jQuery.trim(data)=="session_time_out") {
          window.location.href = site_url+'admin/login.php?timeout=1';                
          } else {
            $('.rebate_block').append(data);
            $('.add_new_rebate').removeAttr('disabled');
          }
          $('.load').remove();
        }
      });    
   });   
  });
  </code></pre>
  
  <p>If you have any other way than combining the above two function into one then also it will be fine. My requirement is to incorporate the code of these two functions into the above AJAX function as I'm generating the two HTML controls dynamically and I want to apply the jQuery classes to them. Thanks in advance.</p>