I have created an array from an HTML form containing the checkbox values.
I was wondering if it is possible to pass the selected checkbox values to jquery to use the Jquery code $('tr#myTableRow').remove(); for each array value that was posted by the form?
Any help is appreciated.
Code:
<form name="deletePost" id="deletePost" action="" method="post">
<input class="checkBox" type="checkbox" id="idArray" name="idArray[]" value="1" />
<input class="checkBox" type="checkbox" id="idArray" name="idArray[]" value="2" />
<input class="formButtonDelete" type="submit" name="submit" value="Delete" />
</form>
$ids = $_POST['idArray'];
if(!empty($ids))
{
foreach($ids as $id)
{
$sql = "DELETE FROM news WHERE id='$id'";
mysql_query($sql);
}
echo 'Posts Deleted - Please refesh page..';
}
I would like to use Jquery to remove the table rows that have the ids of the input values..