I'm trying to do something similar to this question. I want to send to the server the id's of the selected checkboxes. I'm using jquery only because the example. my ajax code is pure JS.
This is my code:
js:
function DeleteTest(ind)
{
if (confirm('Are you sure you want to delete this test?'))
{
$(function() {
var testdel = $('input[name=deletetest]').serialize();
alert(testdel);
window.open('test.php' + "?"+testdel,'_self');
} );
return true;}
else { return false;}
}
oCell.innerHTML = "<input type='checkbox' name='deletetest' value='"+ ind + "')';>"; // create checkbox for each row in ajax
html:
<form id="checkboxform" action="test.php" method="post">
<tbody id="auditTblBody">
</tbody>
</table>
<input type="button" value="Submit AJAX Request" onclick="DeleteTest()" />
</form>
With this code i get only one value with GET.testdel
is fine. (i.e deletetest=477&deletetest=476
) my problem is how to send this information.
thank you!