Seeking assistance with a Javascript filter issue. The code functions correctly outside of Joomla, but when integrated into Joomla, it fails to execute. Suspecting a conflict or blockage hindering its operation.
Tried inserting the code using Sourcerer and Flexi code within a module, but no success. Explored solutions on Stackoverflow to no avail.
No known blockers like RS Firewall are present; verified JCE settings and article options granting JavaScript permissions.
What could be causing this problem? How can I resolve it?
Code snippet:
<script>
function myFunction() {
var input, filter, table, tr, td, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
Have confirmed that the code is functional independently from Joomla. Integration with Joomla poses the challenge.
Grateful for any assistance provided!
Edit: Test page created: test filter table JavaScript snippet located around line 702 in the source.
Thank you!