This topic is locked

Manage confirm box of 'Delete selected' button. ASPRunnerPro 6.3

11/22/2012 1:17:09 AM
ASPRunnerPro General questions
R
RussianGuy author

Hello, ladies and gentlemen!
This is my first post at this forum. So my apologizes if something in it is wrong.
We use ASPRunner Pro 6.3.

My question is concerned with "Delete selected" button. I need to make "Do you really want to delete these records?" confirm box not appear after "Delete selected" button is clicked on, but automatically submit "OK" value and proceed deleting the records (so I can use "Before record deleted" event), i.e. I would like click "Delete selected" button that will delete records directly without necessary to confirm (click "OK") in confirmation box. And I don't want to use any custom button.
I searched a lot accross this forum and sought similar decision but for PHPRunner 5.2 here DELETE CONFIRMATION ALERT MESSAGE

xt->assign("deleteselectedlink_attrs", "name=\"delete_selected1\" onclick=\"if($('input[@type=checkbox][@checked][@name^=selection]').length ){ frmAdmin1.submit();} return false;\"");


Also I sought this code snippet to change parameters of "Save All" button for ASPRunner here Refresh page after Inline Edit

xt.assign "savealllink_attrs","disptype=""control1"" name=""saveall_edited" & id & """ style=""display:none"" onclick=""$('a[@id^=save_]').click();window.location.reload( true );"""


So as a result my decision is:

xt.assign "deleteselectedlink_attrs", "name=""delete_selected1"" onclick=""if($('input[@type=checkbox][@checked][@name^=selection]').length ){ frmAdmin1.submit();} return false;"""


I put it into "Before display" event, but it doesn't work raising an error and the error occur because of frmAdmin1 can't be recognized.

I tried to use $(form) or $('span[@id=record_controls1]') instead of frmAdmin1, and complemented code as follows:

xt.assign "deleteselectedlink_attrs", "name=""delete_selected1"" onclick=""alert('delete button was clicked'); if($('input[@type=checkbox][@checked][@name^=selection]').length ){ $('span[@id=record_controls1]').submit(); alert('Step1');}; alert('Step2'); style.display = 'none'; alert('Step3'); return true; alert('Step4');"""


Alert() and style.display = 'none' were added just to be ensured that code works after "Delete selected" button is clicked on and code works without confirm box pop up and without errors, but it doesn't delete records.
Also I would like to know if there is any way to change the text of confirm box poped up after "Delete selected" button is clicked on just for one specified page of the project, but not for whole project using output\include\lang\English.js file.
Please, sombody help! Thank you in advance!