jQuery $.post doesn't work with when function(response) added
<p>I have the following js function</p>

<pre><code>function remove() {
    jQuery(document).ready(function() {
        jQuery("button").click(function(e) {
            var buttonHnd = jQuery(this);
            jQuery.post("script.php", {
            nume_client: jQuery("#nume_client").val()
            adresa: jQuery("#adresa").val(),
            comanda: jQuery("#comanda").val(),
            locatie: jQuery("#locatie").val(),
            istoric: jQuery("#istoric").val(),
            observatii: jQuery("#observatii").val()
        }, function(response) {
            alert("ok")
        },
        function(data) {
            buttonHnd.closest('tr').remove();
        });
    });
});
}
</code></pre>

<p>When i remove <strong>function(response)</strong> the script works, it removes the row. but i also want to add it to the database. In the <code>script.php</code> file i have only the mysql query with response headers.</p>

<p>The second issue is that my remove button works only on the second click but only after all rows are removed.</p>

<p>Can anyone help with the database problem?</p>

<p>You can find here the <a href="http://www.segasiauto.ro/tmp/script.txt" rel="nofollow">script.php</a> file</p>

<p><strong>EDIT</strong></p>

<p>there was a line missing from this post. the file contains the correct code.</p>
