title: jQuery Logic required for select menu
body: <p>I have created a reiszable box using jQuery UI and I then pass the values to a text box. The values can be in either CM or Inches. </p>
  
  <p>The problem I have is when you drag the size after selecting Centimeters from the unit_type box, It reverts back to Inches. I think I just need to rethink the logic on it and remap it all out.</p>
  
  <p>Can anyone help on this..?</p>
  
  <p>Code is...</p>
  
  <pre><code>$(function()
  {
      $("#resizable").resizable({
          aspectRatio: 16 / 9,
          maxWidth:  $("#max_width").val(),
          maxHeight: $("#max_height").val(),
          resize: function() {
  
              var widthInch = $("#resizable").width() / 200;
              var heightInch = $("#resizable").height() / 200;
  
              $("#unit_type").change(function()
              {
                  var widthCM = $("#resizable").width() / 200 * 2.54;
                  var heightCM = $("#resizable").height() / 200 * 2.54;
  
                  $(".width").val(widthCM + '' + ' CM');
                  $(".height").val(heightCM + '' + ' CM');
              })
  
              var widthCM = $("#resziable").width() / 200 * 2.54;
              var heightCM = $("#resizable").height() / 200 * 2.54;
  
              $(".width").val(widthInch + '' + ' Inches');
              $(".height").val(heightInch + '' + ' Inches');
          }
      });
  })
  </code></pre>
  
  <p>Thanks</p>