Search field not working

Search field not working

marcel96marcel96 Posts: 4Questions: 2Answers: 1

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

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin

    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 the search option with the value.

    Allan

This discussion has been closed.