Thank you Andreas Lagerkvist for Live Search plugin. This will turn a normal form input element in to a live ajax search widget.
I added few configuration options to this plugin:
- minLength: minimum number of characters
- width: the number of pixels in the div-element of results. Can also be set to ’auto’.
We also needed support for multiple search urls when we use it on the Puavo. My changes to this plugin are available on Github. Test and use it and will tell me how it works!
HTML
<div id="jquery-live-search-example"> <form method="post" action="/one-search/"> <p> <label>Enter search terms<br /> <input id="search" type="text" name="q" /> </label> <input type="submit" value="Go" /> </p> </form> </div>
JavaScript
jQuery('#search').liveSearch({ url: ['/one-serach?q=', '/two-search?q='], width: 'auto', minLength: 2 })
Jouni Korhonen
Please attach a working sample to your article i can not combine working sample.
I very disapionted by Andreas who do not show how it work (a mean no backend part and this buggy part of code – Router.urlForModule(’SearchResults’))
This is disrespect.