This article applies to PHPRunner, ASPRunner.NET and ASPRunnerPro.
We added a custom button to the list page that copies selected records to another table. We this button to appear disabled till user selects one or more records. To do so we need to figure button's ID.
Build your project and run it in the web browser. In Chrome browser right-click on your button and choose 'Inspect' which shows us the following:
We can see that button's ID starts with "Copy_Selected". We copy this prefix and paste it into our code. The code itself goes to Javascript OnLoad event of List page in question.
var id = "Copy_Selected";
var button = $("[id^=" + id + "]");
Runner.addDisabledClass(button);
$('input[name="selection[]"], input[id^=chooseAll]').change(function() {
var c = $('input[name="selection[]"]:checked').length;
if (c>0)
Runner.delDisabledClass(button);
else
Runner.addDisabledClass(button);
});
This is it. Our button will be enabled as as soon as we select one or more records on the list page.