JSFiddle - React, Tailwind, and code Playground
HTML
Instructions: click the first submit, notice the alert, click the second submit, notice no alert because no form around the form fields, click the wrap/clone button to wrap the origForm around the other form, now click the second submit button again.
<br /><br />
<form id="origForm">
<input type="text"><input type="text"><input type="submit" value="submit"></form>
<br /><br />
<div id="newForm">
<input type="text"><input type="submit" value="submit">
</div>
<br /><br />
Wrap origForm around newform div <input id="wrapForm" type="button" value="wrap/clone">
JavaScript
$('form').live('submit', function () {
alert('form submitted');
return false;
});
$('#wrapForm').click(function() {
$('#newForm').wrap( $('#origForm').clone().empty() );
});