lovasoa / SQLpage

Fast SQL-only data application builder. Automatically build a UI on top of SQL queries.
https://sql.datapage.app
MIT License
1.55k stars 89 forks source link

the search query parameter is used as the value #359

Closed amrutadotorg closed 4 months ago

amrutadotorg commented 4 months ago

Search Input Field ID:

Added id="search-input" to the search input field for easier identification by the script.

JavaScript Code:

Function getQueryParams: This function parses the query string from the URL and returns an object containing key-value pairs of the parameters. DOMContentLoaded Event Listener: This ensures that the script runs only after the entire page (DOM) has been loaded.

Setting the Input Value: If the search parameter is present in the URL, the script sets the value of the search input field to the value of this parameter.

lovasoa commented 4 months ago

Hello! I'm not sure about serving and executing this script all the time, for everyone. Ideally, the server would serve the input element with a value attribute preset to whatever we want. The easiest is to set value="{{search_value}}" and let the programmer select $search as search_value themselves.

lovasoa commented 4 months ago

Closing in favor of #362