I have a list of items with checkboxes. I need to send that list (just as I would with a form), to a specific PHP file that erased those checked items, and returns the new list.
<table style="float:left;width:100%">
<tbody>
<?php foreach ($items as $item): ?>
<tr>
<div>
<td ?>;
<input type="checkbox" name="item_<?php echo $item['NAME'];?>" value="<?php echo $item['ID'];?>" />
</td>
</div>
</tr>
<?php endforeach; ?>
</tbody>
on the other hand I need to have a javascript function ti serialize all these values like a $_POST.
That’s:
$.get("deleteItems.php", theNeededArray, function(data){....});
so I need to get that array.
I know this: var checkedItems = $("input:checked");
contains what I need but I need to extract those values into an array that looks like this:
{ item_one: “cardboard” , item_two: “rabbit” , …}
I’d love it if someone could also shed some light on the returned value of jQuery. it seems like bigger object than I thought.
You can simply serialize the form: