I’m trying to use document.querySelectorAll inside a HTML file read by Custom Input activity and it’s showing me the following message: “Object doesn’t support property or method ‘querySelectorAll’.”
I want to select all checkboxes associated with a class named OCC through one single checkbox.
HTML:
JAVASCRIPT:
function OCC(source) {
checkboxes = document.querySelectorAll(‘.OCC’);
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
}
I’ve searched and I’ve come across multiple solutions but none of them worked. I guess it’s because none of the previous answers were framed in a UiPath scenario. Do any of you know a workaround?
@franrua02
a first look lets interptetate that the query is searching for elements with the class OCC (indicated by the used dot). But your shown input html snippet is different
so run this statement before in browser web tools (F12) javascript console and check if its returning anything.
We made the best efforts by not changing the function argument names. So let it b the name as used in the documentation from uipath
Hi, thank you for answering.
It’s different (doesn’t have OCC class) because that’s the checkbox that triggers the function OCC when clicked.
I can’t show the whole code because of confidentiality issues but since a misunderstanding arose, I decided to replicate a snippet of the code just as if it were to be used as an argument of the custom input activity:
I’m sorry but I don’t seem to understand why you keep telling me there are no elements with class name OCC in the HTML, when in fact I added four of them. (right below a snippet of the code I took out of the URL provided before )
Although I muss add that even if it were the case - no element with class ‘OCC’ - it shouldn’t be a problem since no checkboxes would be selected.