So I have text input connected to my database, this text input in turn is connected to a search button (see code below). Where the search button is BUTTON1 and the text input is #INPUT1 and data is then displayed in a table on the same page #TABLE1
This all works fine, if a user enters a 15 digit number which corresponds to a matching value
under the MICROCHIPNUMBER field in the database, the table will display the corresponding info. What is ALSO happening though (which I want to prevent) is that if NO value is added into the text input, and the search button is clicked. THE ENTIRE database is populated in the table. ie: ALL MICROCHIPNUMBER fields and their corresponding data are populated in the table.
How do I prevent this from happening as this would be a privacy breach.
ok, awesome. Just gave that a try and its working! THANK YOU!. While I have your attention, would you mind if I query you about another issue I’m having which is actually preventing me from putting my site live?
You could add a check. I apologize ahead of time because I’m on my phone and using the wix app so it wont look pretty and Wont be 100% what you would type in.
But something along the lines of
If ($w(“#input1”).value !== “”) {
Run query
}
Or you could use length !== 0
And possibly .value !== null or undefined.
Basically if the value is not empty, run the query.