Search field not working
Search field not working
Hi,
thats my problem:
The site is loaded with a url. This url contains one parameter (....php?search=Test)
In this case, I am reading the search-variable.
This text (here: Test) is set as a value from the searchfield of a data table. Also autofocus is set.
Question: Why is the field not working automatically? I first need to click a letter or something else to make the searchfield work. Otherwise, the DataTable isn't searching for my value. The searchfield was individualized. In general it is working as it should.
Any help please? Do you need more Code?
<input type="text" name="searchBar" value='<?echo $searchValue?>' id="searchBar" size="50" placeholder="Search..." autofocus>
Answers
DataTables won't automatically get information from the URL's query string. If you need that ability you need to do it yourself (
window.location.query
) and then set thesearch
option with the value.Allan