});
// Implements User Search
$('#usersearchform input').keyup(function() {
- var inputVal = $(this).val();
- $('table tbody tr td.name').each(function() {
- if ($('table tbody tr').text().search(new RegExp(inputVal, "i")) < 0) {
- $('table tbody tr').fadeOut();
+ var inputVal = $(this).val(), regex = new RegExp(inputVal, "i");;
+ $('table tbody tr td.name').each(function (key,element) {
+ if (regex.test($(element).text())) {
+ $(element).parent().show();
} else {
- $('table tbody tr').show();
+ $(element).parent().hide();
}
});
});
</div>
<?php endif; ?>
<form autocomplete="off" id="usersearchform">
- <label><?php p($l->t( 'Search' )); ?></label>
- <input type="text" class="input" />
+ <input type="text" class="input" placeholder="<?php p($l->t( 'Search by Username' )); ?>" />
</form>
</div>
<table class="hascontrols grid" data-groups="<?php p(json_encode($allGroups));?>">