Searching a table from another site

Searching a table from another site

tcempktcempk Posts: 2Questions: 1Answers: 0

I have a datatable on my Wp page ( for example -> www.example.com/info, writen in html ). The datatable has five columns and I've setup search for the first three columns, outside the table ( one is text based search and two are drop down options searches ) and it all works great. Now I want to move these searchs to my homepage www.example.com, so a user would be able to input the search variables on the homepage, and when submitting said search would be taken to www.example.com/info with all the data already filtered according to the search parameters.

This is a Jfiddle of my whole setup https://jsfiddle.net/6sb2dcx8/

Answers

  • allanallan Posts: 61,774Questions: 1Answers: 10,112 Site admin

    Use the search parameter to specify an initial search term when the table is loaded. You could read that from the query parameters or an anchor when the page is loaded.

    Allan

  • tcempktcempk Posts: 2Questions: 1Answers: 0

    hey Allan. I'm sorry, but I'm a begginer coder, so i'd need a bit more info on your answer. Thanks

  • allanallan Posts: 61,774Questions: 1Answers: 10,112 Site admin

    Here is a SO thread on how to get a parameter from a query string in Javascript.

    You would then use that value as the search value to perform an initial search on the table.

    Allan

This discussion has been closed.