1BY LOVE SINGH,
2Call this function onKeyUp event of TEXTBOX.
3
4function myFunction() {
5 var input, filter, table, tr, td, i;
6 input = document.getElementById("TextBoxID");
7 filter = input.value.toUpperCase();
8 table = document.getElementById("TableID");
9 tr = table.getElementsByTagName("tr");
10 for (i = 0; i < tr.length; i++) {
11 td = tr[i].getElementsByTagName("td")[1];
12 var x = $("#TextBoxID").val();
13 var regex = /^[a-zA-Z]+$/;
14 if (!x.match(regex)) {
15 td = tr[i].getElementsByTagName("td")[0];
16 }
17 if (td) {
18 if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
19 tr[i].style.display = "";
20 } else {
21 tr[i].style.display = "none";
22 }
23 }
24 }
25 }
1BY LOVE SINGH,
2Call this function onKeyUp event of TEXTBOX.
3
4function myFunction() {
5 var input, filter, table, tr, td, i;
6 input = document.getElementById("TextBoxID");
7 filter = input.value.toUpperCase();
8 table = document.getElementById("TableID");
9 tr = table.getElementsByTagName("tr");
10 for (i = 0; i < tr.length; i++) {
11 td = tr[i].getElementsByTagName("td")[1];
12 var x = $("#TextBoxID").val();
13 var regex = /^[a-zA-Z]+$/;
14 if (!x.match(regex)) {
15 td = tr[i].getElementsByTagName("td")[0];
16 }
17 if (td) {
18 if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
19 tr[i].style.display = "";
20 } else {
21 tr[i].style.display = "none";
22 }
23 }
24 }
25 }
26