Hardist
07-13-2012, 07:41 AM
Hey guys and girls,
I've been looking for a script that basically changes my query whenever I enter something in an input field. I only want this to change in my query upon typing something:
LIKE '$search'
I have a big page with a lot of code, tables, and so on, and I would like the output of this to change whenver I type something in the input field. I have a grocery list where I can select the groceries I will be needing for the next week. I have a LOT of groceries displayed on one page, within one query, about 120 items. It sucks to always search for the stuff using CTRL+F for example, and I do not want to hit any submit buttons each time I am searching using an input field. I want a live search, something very basic, but what does the job.
For example, this is how my page looks like after getting the information from the database table:
<table>
<tr>
<td>Name</td>
<td>Age</td>
<td>E-Mail</td>
</tr>
<tr>
<td>Alpha</td>
<td>25</td>
<td>alpha@something.com</td>
</tr>
<tr>
<td>Bravo</td>
<td>30</td>
<td>alpha@something.com</td>
</tr>
<tr>
<td>Charlie</td>
<td>35</td>
<td>alpha@something.com</td>
</tr>
</table>
Now, whenever I type the letter "A" into my input field, I only want this to be displayed (and it should be changing live whenever I type the "A"):
<table>
<tr>
<td>Name</td>
<td>Age</td>
<td>E-Mail</td>
</tr>
<tr>
<td>Alpha</td>
<td>25</td>
<td>alpha@something.com</td>
</tr>
</table>
But the thing is, I want this to change without hitting any submit buttons. I have found loads of scripts that can do this, but my problem is always that the results are being displayed in a div or in another input field or whatever. I only want my query to change whenever I type something.
Does anyone have a simple, basic script that can handle this or can someone point me into the right direction? Thanks in advance!!
I've been looking for a script that basically changes my query whenever I enter something in an input field. I only want this to change in my query upon typing something:
LIKE '$search'
I have a big page with a lot of code, tables, and so on, and I would like the output of this to change whenver I type something in the input field. I have a grocery list where I can select the groceries I will be needing for the next week. I have a LOT of groceries displayed on one page, within one query, about 120 items. It sucks to always search for the stuff using CTRL+F for example, and I do not want to hit any submit buttons each time I am searching using an input field. I want a live search, something very basic, but what does the job.
For example, this is how my page looks like after getting the information from the database table:
<table>
<tr>
<td>Name</td>
<td>Age</td>
<td>E-Mail</td>
</tr>
<tr>
<td>Alpha</td>
<td>25</td>
<td>alpha@something.com</td>
</tr>
<tr>
<td>Bravo</td>
<td>30</td>
<td>alpha@something.com</td>
</tr>
<tr>
<td>Charlie</td>
<td>35</td>
<td>alpha@something.com</td>
</tr>
</table>
Now, whenever I type the letter "A" into my input field, I only want this to be displayed (and it should be changing live whenever I type the "A"):
<table>
<tr>
<td>Name</td>
<td>Age</td>
<td>E-Mail</td>
</tr>
<tr>
<td>Alpha</td>
<td>25</td>
<td>alpha@something.com</td>
</tr>
</table>
But the thing is, I want this to change without hitting any submit buttons. I have found loads of scripts that can do this, but my problem is always that the results are being displayed in a div or in another input field or whatever. I only want my query to change whenever I type something.
Does anyone have a simple, basic script that can handle this or can someone point me into the right direction? Thanks in advance!!