wingpeople
Programmer
I'm running a SELECT that returns several records in a recordset. I want to display all the records retrieved, with a "CHANGE" and a "DELETE" button below each record.
I use a WHILE...NOT EOF loop to iterate through the recordset.
I've got it displaying the records OK, I've got the buttons displaying OK, and I've got the CHANGE button working OK (it does a redirect). However, I'm having problems with the DELETE button.
I define the button within the WHILE...NOT EOF loop this way:
<button type="button" onClick="<%DeleteTheRecord(ID)%>">Delete</button>
I have a vbScript function called DeleteThisRecord which gets passed the ID and runs a DELETE query to delete the record.
The problem is that DeleteThisRecord is getting called as I iterate through the recordset, so all the records get deleted (one at a time) before the user ever gets to see the data OR either of the Buttons. Shouldn't this function only be invoked AFTER the user clicks a DELETE button associated with one of the records in the recordset?
I use a WHILE...NOT EOF loop to iterate through the recordset.
I've got it displaying the records OK, I've got the buttons displaying OK, and I've got the CHANGE button working OK (it does a redirect). However, I'm having problems with the DELETE button.
I define the button within the WHILE...NOT EOF loop this way:
<button type="button" onClick="<%DeleteTheRecord(ID)%>">Delete</button>
I have a vbScript function called DeleteThisRecord which gets passed the ID and runs a DELETE query to delete the record.
The problem is that DeleteThisRecord is getting called as I iterate through the recordset, so all the records get deleted (one at a time) before the user ever gets to see the data OR either of the Buttons. Shouldn't this function only be invoked AFTER the user clicks a DELETE button associated with one of the records in the recordset?