Forums

PHP

This topic is locked

delete record server behaviour

Posted 02 May 2005 23:51:21
1
has voted
02 May 2005 23:51:21 walter napoleon posted:
I have a problem in a delete record behaviour.
I make a list of records in a tabel using the repeat region behaviour for a tablerow that shows a row off formfields that contains active data out of a recordset and a delete button in the last column. A formfield contains the primary key field which is used in the delete record server behaviour attached to the delete-button. With this field the appropriate record should be deleted. However it is always the last record of the list that is deleted. I do not want to use a special delete-record-page for this purpose.
Is it possible what I want to realise?

Replies

Replied 03 May 2005 01:25:29
03 May 2005 01:25:29 Chris Charlton replied:
Ah, it seems that your hidden fields (the item ID's), the latest one is being used for the DELETE. The quickest way to get around it is to shrink your form area, meaning, wrap only the hidden field + the delete button with a form that calls the delete function. For a lot of row, this will generate a lot of forms on the rendered repeats, but screw it, you're not making them by hand. So, each 'delete' will be processing their own form, in each row.

The other alternative, will take more work, but you change the 'delete' buttons to a checkbox, have the value of the checkbox be the ID, then you do some code to grab the array of checkboxes, then process which ones are checked. Like I said, more work but needs only one form wrapped around the data table.

~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 03 May 2005 02:29:30
03 May 2005 02:29:30 walter napoleon replied:
This is a clear explanation. I will try both ways <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
Thanks

Reply to this topic