There is form with a list of items created dynamically in PHP, each has it’s id(I mean database id, not the element’s).
Each item has two radiobuttons (Good,Bad).
Is there a way to get in PHP an array of all items that are Bad and all item that are Good as if I was using checkboxes with names good[] and bad[] and value=”id” for each item.
Is there a way to make this with radiobuttons?
<form action="some.php" method="post">
item 1: <br/>
<input type="radio"/>Leave<br/>
<input type="radio"/>Delete<br/>
item 2: <br/>
<input type="radio"/>Leave<br/>
<input type="radio"/>Delete<br/>
</form>
No, you can’t quite do it like you would with checkboxes.
Instead you need to accept all the name=””‘s of the radiogroups and loop through them, building your own array in PHP after accepting the form.