I have between 1-10 form fields posted to a php script that collects the values from existing fields and use that data
Since I am trying to change some functions on the site to ajax I wonder how I can, with jquery, find all the fields with the name amount-*and put their values in a comma separated string and then post it to the server side script via ajax like this:
New code
$("#div").load("/serverscript.php", {ids:commaSeparatedValues}
Old code
while(isset($_POST['amount-'.$indexCount])){
$changedCartAmount = $changedCartAmount . $_POST['amount-'.$indexCount] . ',';
$indexCount++;
}
$changedCartAmount = substr($changedCartAmount,0,-1);
$arrayChangedCartAmount = explode(",",$changedCartAmount);
1 Answer