jQuery / Ajax search by particular field

759 Views Asked by At

I have it all setup and working fine - what id like to do is have it only search by one particular field in a table (td with class of test).

Im using $('input#SearchBox').quicksearch('table#tablesorter-demo tbody tr');

which searches all the fields in the table, I have tried:

$('input#SearchBox').quicksearch('table#tablesorter-demo tbody tr td.test');

but this just stops the whole search from working, ideas appreciated?

2

There are 2 best solutions below

1
On

Try being less specific in your criteria:

$('input#SearchBox').quicksearch('.test');
7
On

Try this:

$('input#SearchBox').quicksearch('table#tablesorter-demo tbody tr', {'selector': 'td.test'})

Working JSFiddle Example