title: jquery clone an input doesn't see changes to the value
body: <p>I have a form with hidden inputs. </p>
  
  <p>I .clone() them and show them to the user in a .dialog(). </p>
  
  <p>The user makes some changes and i use .val() to change the hidden fields.</p>
  
  <p>However the next time i clone the form(without reloading the page) i have the initial values again, and never the updates ones.</p>
  
  <p>There seems to be this weird bug/result? see <a href="http://jsfiddle.net/YvBfP/" rel="nofollow">http://jsfiddle.net/YvBfP/</a>  (broken for visible input too)</p>
  
  <pre><code>$(this).closest('td').find('button').click( function ()
  {
      var d = $('#pagamento_anticipato').html();
  
      $(d).dialog({
          modal: true,
          width: 400,
          height: 300,
          close: function( event, ui ) {
                  var importo = $(this).find('input[type="text"]').val();
                  var descrizione = $(this).find('textarea').val();
                  var select = $(this).find('select').val();
                  $(this).remove();
  
                  $('#pagamento_anticipato').find('input[id="importo"]').val( importo );
                  $('#pagamento_anticipato').find('#descrizione').val( descrizione );
                  $('#pagamento_anticipato').find('#tipo').find('option[value="' + select + '"]').attr('selected', true);
  
              }
      });
      return false;
  });
  </code></pre>