Commit 74f90633 authored by Zosman's avatar Zosman
Browse files

trying to get an error message when nothing shows up. fuck it. probably gonna...

trying to get an error message when nothing shows up. fuck it. probably gonna open an issue for that and make it bite sized cuz i dont wanna. :dhaynes: 
parent 0942f75c
Pipeline #804 passed with stage
in 1 minute and 27 seconds
......@@ -184,5 +184,5 @@ SRCT Go • Administration Panel
</form>
</div>
</div>
<script src = "../../static/js/useradmin.js"> </script>
{% endblock %}
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")[2];
input = document.getElementById("myInput"); // the var that holdes input from text box
filter = input.value.toUpperCase(); //makes the input all uppercase for some fucking reason
table = document.getElementById("myTable"); // the table at the moment this is called
tr = table.getElementsByTagName("tr"); //the table rows
for (i = 1; i < tr.length; i++) { // loops through the table rows
td = tr[i].getElementsByTagName("td")[2]; //sets td to the element, gets changed evrey loop itteration
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
// tr[1].style.display = "No results match your search! ¯\\_(ツ)_/¯"
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment