あなたがこれを手伝ってくれることを願っています。入力フィールドのあるライブ検索テーブル
私はhtmlテーブルのライブ検索をしようとしていますが、各セルにはテキストしか含まれていないときに動作するようになっています。私はその後、テキストをinput type = "text"に変更して、読み込みのみを切り替えることができました。 今私はテーブルを検索しようとしています、そして、それは50%に動作します。私はテキストでやったように、各行のすべての入力を検索できるようにしたいが、今は各行の最初の入力を受け取り、私は立ち往生している。
ここは私のコードです: 表包まれたテーブル>のtbody
<form method="post" action="'. $_SERVER["PHP_SELF"] .'" >
<input type="hidden" name="id" value="' . $row['id'] . '">
<tr>
<td style="font-weight: 700;">
<input class="name" type="text" name="name" value="' . $row['name'] . '" readonly>
</td>
<td>
<input type="text" name="phone" value="' . $row['phone'] . '" readonly>
</td>
<td>
<input type="text" name="email" value="' . $row['email'] . '" readonly>
</td>
<td>
<input type="text" name="business_name" value="' . $row['business_name'] . '" readonly>
</td>
<td>
<input type="text" name="title" value="' . $row['title'] . '" readonly>
</td>
<td class="actions send">
<a href="mailto:'. $row['email'] .'">
<i class="fa fa-send"></i>
</a>
</td>
<td class="actions edit">
<button type="submit" name="edit_people">
<i class="fa fa-pencil"></i>
</button>
</td>
<td class="actions contacted">
<button type="submit" name="contacted_people" value="' . $row['contacted'] . '">
<i class="fa fa-comment" style="' . $switch . '"></i>
</button>
</td>
<td class="actions remove">
<button type="submit" name="remove_people">
<i class="fa fa-close"></i>
</button>
</td>
</tr>
</form>
それはループ
TR
私のDBを出力する複数のトラフと、ここで私のjqueryのです$("#Search").keyup(function() {
_this = this;
// Show only matching TR, hide rest of them
$.each($('.addressbook tbody tr'), function() {
if ($(this).find('input[type="text"]').val().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1)
$(this).hide();
else
$(this).show();
});
});
は、あなたがすることを願ってこれで私を助けてください。 ベスト/フレドリック
可能な複製を必要に応じて(https://stackoverflow.com/questionsを試してみてください/ 12433304/live-search-through-table-rows) –