title: Select2 : Get the previous selected option value from my 1st select
body: <p>I have 2 select2 dropdown.</p>
  
  <p>1) Put some validation, when the value is already selected in select 1 it will now disable in select 2.</p>
  
  <p>2) Now if the user change the value of select 1, the value of previous in select 1 it will now enable in select 2</p>
  
  <pre><code>Example
  
  Select 1 = A - selected
             B
             C
  Select 2 - A - disabled
             B 
             C 
  
  User changed the value in Select 1
  
  Select 1 - A
             B
             C - selected
  Select 2 - A - will now enable.
             B
             C - disabled
  </code></pre>
  
  <p>Question: How can I enable the previous value of the first selected value in select 1?</p>
  
  <p><strong>Jquery</strong></p>
  
  <pre><code>$(document).on('select2:select', '#warehouse_from', function(e){
          //send ajax request
          var id         = $(this).val(); 
          var val        = $('#warehouse_from option:selected').text();
          $('select#warehouse_to&gt;option[value="'+id+'"]').attr('disabled','disabled');
          getItemsByWarehouse(id);
          e.preventDefault();
          return false;
      });
  </code></pre>