jQuery has a clone() function that clones the actual form with no problem, but it doesn\'t preserve any values that have been entered into the form.
Is
Stemming from the notes, here's a solution. With the following form:
This jQuery works, including the textareas:
$( 'input#clone' ).click(
function()
{
$( 'form#old textarea' ).text( $( 'form#old textarea' ).val() )
$("form#old").clone().attr( 'id', 'new_form' ).appendTo("body")
}
)
Demo: http://jsfiddle.net/Jux3e/