This topic is locked
[SOLVED]

 Selecting single checkbox on list page

10/12/2019 3:37:30 PM
PHPRunner General questions
K
keithh0427 author

Hello all,
On my List page, I added the ability to delete rows which created a checkbox for each row (record). I don't really delete the record though. I handle some processing through the "Before record deleted" and "After record deleted" events. But, I only want to do one at a time. I don't want the user to be able to select multiple rows. I want them to be able to select one record and one record only before going on to the next record. They should unselect the selected record and then be able to select the next record to work on. All in random order. How can I make this work?

N
Nir Frumer 10/14/2019

hi

on javascript onload
var id = "Delete button label";

var button = $("[id^=" + id + "]");

Runner.addDisabledClass(button);
$(':checkbox').change(function() {
var c = $('input[name="selection[]"]:checked').length;
if (c==1)

Runner.delDisabledClass(button);

else

Runner.addDisabledClass(button);
});
hope it helps,

Nir.

K
keithh0427 author 10/14/2019



hi

on javascript onload
var id = "Delete button label";

var button = $("[id^=" + id + "]");

Runner.addDisabledClass(button);
$(':checkbox').change(function() {
var c = $('input[name="selection[]"]:checked').length;
if (c==1)

Runner.delDisabledClass(button);

else

Runner.addDisabledClass(button);
});
hope it helps,

Nir.

K
keithh0427 author 10/14/2019



hi

on javascript onload
var id = "Delete button label";

var button = $("[id^=" + id + "]");

Runner.addDisabledClass(button);
$(':checkbox').change(function() {
var c = $('input[name="selection[]"]:checked').length;
if (c==1)

Runner.delDisabledClass(button);

else

Runner.addDisabledClass(button);
});
hope it helps,

Nir.


Am I just missing your concept. Sorry, but I don't understand.
Maybe it's just me, but what I'm wanting to limit is the checkbox on each row. Not really buttons. I did try this but didn't get anywhere.

Admin 10/14/2019

This code disables/enables Delete button based on the number of selected checkboxes. You need to modify this code replacing "Delete button label" with the actual label of Delete button.

K
keithh0427 author 10/14/2019

Thank you!