Save/output dynamically generated html source using jquery
<p>I have a search form that can be built dynamically by the user using code such as:</p>

<p><code>$('tr.form_row:last').clone(true).insertAfter('tr.form_row:last');</code></p>

<p>All of this is working fine, however, I would like to save the dynamically generated form html when the form is submitted.  I have tried using <code>$(#my_form').html()</code> but this doesn't appear to have the dynamic content, instead, it's just the default html before customisation that is gathered.</p>

<p>Is there a way of getting the generated source using javascript/jquery?  It would need to include the value within the input fields that the user has typed etc.</p>

<p><strong>EDIT</strong> - I've included my coding so far:</p>

<p>This is the coding I have tried - it uses jquery form plugin and I populate a hidden form field called 'search_html':</p>

<pre><code>var search_form = {
    beforeSubmit: function() {
        var search_html = '&lt;table&gt;';
        $('.form_row').each(function() {
            search_html += $(this).html();
        });
        search_html += '&lt;/table&gt;';
        $("#search_html").val(search_html);
    },
    success: function(html) { 
        $('#search_output').html(html);
    } 
};  
$('#search_form').ajaxForm(search_form);
</code></pre>

<p>When I submit the form, HTML is passed within the hidden 'search_html' field, but it is only the first table row and doesn't have the values of the input fields populated.</p>
