This topic is locked
[SOLVED]

 double confirm on "delete selected"?

5/29/2011 10:18:29 AM
PHPRunner General questions
M
mickna author

Hi there,
is it possible to have a double confirmation before a user deletes a record?

My users should be able to delete their own account. Before all is deleted, I'd like to have a second confirmation popup before or after the standard one ("Do you really want to delete these records?")

Possible? I'll guess this could be done with List Page/Before display and assign some magic code in "deleteselectedlink_attrs" But I can not figure out how to do this.
Any ideas?
thanks,

mickna

L
Lena 5/30/2011

Hi,
unfortunately there is no easy way to implement new confirmation with replacing deleteselectedlink_attrs in the Before display events on the List page in the PHPRunner 5.3.

As workaround you can disable "Delete selected" button and use the custom button to display your confirmation message and enable the "Delete selected" button only if the user confirms deleting.
Here the example code for "Client Before" tab of custom button:

var selBoxes = $('input[@type=checkbox][@checked][@id^=check'+id+'_]');

if(selBoxes.length == 0 || !confirm('Your message')){

return false;

}

else {

//enable the "Delete selected" button

}

return false;
M
mickna author 5/30/2011

Hi Lena,
thank you for your answer.

It's exactly what I have done right now. Custom Button and then the coding.
thank you,

mickna