I am trying to figure out why this is not working. Here is the sub-set of my form that looks like this:
<input type="hidden" id="gift_id3" name="giver3gift_id" value="925"></td>
<tr id="tr3">
<td>
<select class="type" id="type3" name="giver3paymenttype_val">
<option value="1" SELECTED>Check</option>
<option value="2">Cash</option>
<option value="3">ACH</option>
<option value="4">In Kind Donation</option>
</select>
</td>
<td><input type="text" class="refnum" id="refnum3" name="giver3ref_num" value="2147483647"></td>
<td><input type="text" class="amount" id="amount3" name="giver3amount" value="25.00" onBlur="this.value=formatCurrency(this.value)"></td>
<td>
<select class="type" id="type3" name="giver3taracct_val">
<option value="1" SELECTED>General Fund</option>
<option value="2">Building Fund</option>
<option value="3">Missions Fund</option>
</select>
</td>
<td><input type="checkbox" id="void3" name="giver3void">
</tr>
Here is my AJAX:
var $inputs = $("#dialog-editgiving :input");
var parameters = [];
$inputs.each(function() {
parameters[this.name] = $(this).val();
});
$.ajax({
url : "./scripts/form_process/update_giving.php",
type: "POST",
data : {parameters:parameters},
success: function(data, textStatus, jqXHR)
{
alert(data);
},
error: function(jqXHR, textStatus, errorThrown)
{
alert(errorThrown);
}
});
Here is my update_giving.php file
<?php
foreach ($_POST as $key => $value) {
echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
}
?>
When I look through the $inputs array, I get the the values that are submitted in the form. Then it is handed off to the "./scripts/form_process/update_giving.php" script, I get nothing in the POST object.
Do I have something incorrect in my AJAX request?