Last active
May 11, 2018 19:24
-
-
Save olivx/d2d72a1242cc2c44ad72c47534ad3125 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filter(element, selector) { | |
var value = $(element).val().toUpperCase(); | |
$(selector +" li").each(function () { | |
if ($(this).text().toUpperCase().indexOf(value)> -1) { | |
$(this).show(); | |
} else { | |
$(this).hide(); | |
} | |
}); | |
} | |
$('.search_client_list').keyup(function(){ | |
filter(this, '#list-client'); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function searching() { | |
var input, filter, table, tr, td, i; | |
input = document.getElementById("search_box"); | |
filter = input.value.toUpperCase(); | |
table = document.getElementById("tbl"); | |
tr = table.getElementsByTagName("tr"); | |
for (i = 0; i < tr.length; i++) { | |
td = tr[i].getElementsByTagName("td")[1]; | |
if (td) { | |
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) { | |
tr[i].style.display = ""; | |
} else { | |
tr[i].style.display = "none"; | |
} | |
} | |
} | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="col-md-6"> | |
<div class="input-group"> | |
<input id="search_box" type="text" name="search_box" value="" class="form-control" | |
ondragover="" ondragover=" " ondragover="" placeholder="buscar por nome" onkeyup="searching()"> | |
<span class="input-group-btn"> | |
<button type="button" name="button" class="btn btn-primary"> | |
<i class="glyphicon glyphicon-search"></i> | |
</button> | |
</span> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment