HTML5 Form Submission Equivalent $.post
So, I'm working on a small web app and I have it to a point where I can input data into a form, click a button, and delete that data from a form. I'd like to be able to just click on the data in a table and have it do a similar function, i.e. somehow use $.post to post the data instead of making the form do it. I'm at a loss of how to do it though. I've read several tutorials and articles and am at a loss of how to replicate the form's submit functionality.

Here's my current way of doing things via form/php:

**The Form Template**
    
    <form name="DeleteMarker" action="index.php" target="_self" method="post">
               	 <fieldset class="Splice">
                    <legend>Delete Marker</legend>
                   		<label>Employee: </label><select name="DEmployee">
                        <label>Job Name: </label><select name="DJob">
                       	<label>Customer Name: </label><select name="DCustomer">
                        <br>
        				<label>Latitude: </label><input name="DLatitude" min="-180" max="180" step="0.00001" required />
        			   	<label>Longitude: </label><input name="DLongitude" min="-180" max="180" step="0.00001" required />
        				<br>
                        <input type="submit" value="Delete" />
                </fieldset>
          	</form>

**The PHP**

    if(isset($_POST['DEmployee'])) {
    		$sql="DELETE FROM Splices WHERE (Employee='$_POST[DEmployee]' AND Job='$_POST[DJob]' AND Customer='$_POST[DCustomer]' AND Latitude=$_POST[DLatitude] AND Longitude=$_POST[DLongitude])";
    		if (!mysql_query($sql,$Splices)) {
    			die('Error: ' . mysql_error());
    		}

I have a javascript function where a click on the table will display an alert, I just need to figure out how to put a $.post or $.ajax statement in there to replicate the functionality of the form I already have. 

**The (incorrect) javascript I have:**

    function deleteRecord(e,j,c,l,ln) {
    		confirm("Delete Record ("+e+", "+j+", "+c+", "+l+", "+ln+")?");
    		if(confirm){
    			$.post("index.php", {DEmployee:e, DJob:j,DCustomer:c,DLatitude:l,DLongitude:ln});;
    		}
    }
HTML5 Form Submission Equivalent $.post
===

So, I'm working on a small web app and I have it to a point where I can input data into a form, click a button, and delete that data from a form. I'd like to be able to just click on the data in a table and have it do a similar function, i.e. somehow use $.post to post the data instead of making the form do it. I'm at a loss of how to do it though. I've read several tutorials and articles and am at a loss of how to replicate the form's submit functionality.

Here's my current way of doing things via form/php:

**The Form Template**
    
    <form name="DeleteMarker" action="index.php" target="_self" method="post">
               	 <fieldset class="Splice">
                    <legend>Delete Marker</legend>
                   		<label>Employee: </label><select name="DEmployee">
                        <label>Job Name: </label><select name="DJob">
                       	<label>Customer Name: </label><select name="DCustomer">
                        <br>
        				<label>Latitude: </label><input name="DLatitude" min="-180" max="180" step="0.00001" required />
        			   	<label>Longitude: </label><input name="DLongitude" min="-180" max="180" step="0.00001" required />
        				<br>
                        <input type="submit" value="Delete" />
                </fieldset>
          	</form>

**The PHP**

    if(isset($_POST['DEmployee'])) {
    		$sql="DELETE FROM Splices WHERE (Employee='$_POST[DEmployee]' AND Job='$_POST[DJob]' AND Customer='$_POST[DCustomer]' AND Latitude=$_POST[DLatitude] AND Longitude=$_POST[DLongitude])";
    		if (!mysql_query($sql,$Splices)) {
    			die('Error: ' . mysql_error());
    		}

I have a javascript function where a click on the table will display an alert, I just need to figure out how to put a $.post or $.ajax statement in there to replicate the functionality of the form I already have. 

**The (incorrect) javascript I have:**

    function deleteRecord(e,j,c,l,ln) {
    		confirm("Delete Record ("+e+", "+j+", "+c+", "+l+", "+ln+")?");
    		if(confirm){
    			$.post("index.php", {DEmployee:e, DJob:j,DCustomer:c,DLatitude:l,DLongitude:ln});;
    		}
    }