
Hello,
I am trying to checking checkboxes in a range from 1 to 2000 using Run JavaScript function on web page action. The script runs without errors, but the checkboxes are not getting checked.
// Define the range of checkboxes to select
var startIndex = 1; // Start index (1-based)
var endIndex = 3; // End index (1-based)// Loop through the range and select the checkboxes
for (var i = startIndex; i <= endIndex; i++) {
var selector = "#imageRepeater__ctl" + i + "_chkAssign"; // Dynamic selector
var checkbox = document.querySelector(selector); // Find checkbox
if (checkbox) {
checkbox.checked = true; // Check the checkbox
console.log("Checked: " + selector);
} else {
console.log("Checkbox not found: " + selector);
}
}