Form not submitting after input button is changed with replaceWith
<p>I have a form in which I click a button "Open" after the click, the button is replaced with a different button "Save", however, the save button does not submit the form.</p>

<pre><code>$(function() {
    // activate a row
    $(".activate").live('click', function() {

        var rec = $(this).attr('rec');
        var status = $(this).attr('status');

        if (status == 1) {
            disable_attributes(rec);
            $("#activate_" + rec).replaceWith('&lt;input type="button" name="activate" id="activate_' + rec + '" class="activate" value="Open" rec="' + rec + '" status="0"&gt;');
        }
        else {
            open_row(rec);
            enable_attributes(rec);
            $("#activate_" + rec).replaceWith('&lt;input id="save_' + rec + '" class="update" type="submit" value="Save" name="submit"&gt;').submit_reservation_form();
            // add row to active_user_rows
        }
    });


    $('.clock').popover({
        placement: 'left'
    });
});​
</code></pre>
