Update instead of Delete

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
FedeLopez
User
Posts: 107

Update instead of Delete

Post by FedeLopez »

Hi all... I have a "Status" field on each table...
where possible status are:
1 = ok
2 = check
3 = deleted.

Users can´t see deleted... admins see them in red background.
I added on Delete Page -> Page_Load

ExecuteUpdate(
UPDATE TableName
SET FieldName = 3
WHERE IDFIeld = Route(1))

and then back to list pge... and actually work...
But... I would like to add some confirm... or do that action when user submit the "delete" button...
right now it the item dissapear from list (except for admins) as soon as he press the Tras can icon...

Thanks


arbei
User
Posts: 9292

Post by arbei »

If you have not enabled "Inline-Delete", the user will be redirected to the Delete page to confirm, but you execute your UPDATE statement and go back to the List page on Page_Load, so there is no confirmation.

You may try to enable "Inline-Delete" so there is a JavaScript confirm dialog before accessing the Delete page, see Table Setup -> Delete.


FedeLopez
User
Posts: 107

Post by FedeLopez »

That did work perfectly.

Thanks


Post Reply