I gave the button code another go but yet again its doing the same thing, deleting the last record in a list rather than the one selected. I followed your instructions by adding the following code
<input name="deleteID" type="hidden" id="deleteID" value="<?php echo $row_Recordsetfindallprodid['purchaseid']; ?>">
<input name="deleteproduct" type="submit" class="custom_button_red" id="deleteproduct" value="-" onClick="document.getElementById('deleteID').value=<?php echo $row_Recordsetfindallprodid['purchaseid']; ?>">
then amending the server behavior to point at the deleteID hiden element as shown below
<?php echo((isset($_POST["deleteID"]))?$_POST["deleteID"]:"") ?>
As I say I have tried numerous other attempts, but to no avail. It will not select the correct record id for deletion. I have tried it with hidden elements and text fields. I'm beginning to think it may be down to the MySQL code that is attached to the repeat region.
I did try something I created a temporary field and pointed it at the purchase recordid, then i created a simple link 'testlink' and pointed that at the same page and the temporary field. similar to the following.
page_4.php?tmp=<?php echo((isset($_POST["tmp"]))?$_POST["tmp"]:"") ?>
When hovering the mouse over the link, their is no value visible.
So if no value is being sent to the server, I guess the delete behavior is just deleting the last record in the database table. I have had issues with the isset($_POST function before, so could that be the culprit, it is posting even though the variable is empty.
I'm not sure Jason, I'm no php developer at all