suppose the following is a loop
// <form> form
<? while ($row = ... { ?>
<button class="btn-selector" data-id="<?=$row["prod_id"];?>">select this</button>
<? } ?>
// </form>
if there are five prod
, there will be five buttons
<button class="btn-selector" data-id="100">select this</button>
<button class="btn-selector" data-id="101">select this</button>
<button class="btn-selector" data-id="102">select this</button>
<button class="btn-selector" data-id="103">select this</button>
<button class="btn-selector" data-id="104">select this</button>
each loop has a button, plus data-id "s prod_id
when the while is not in a form,
how can I know which prod_id
he selected?
suppose I press 101102104 (without submit)
how can I throw these three into array to the backend?
who is selected, let"s throw everyone into the backend.
is it true?