Happy New Year - 2019!!!
I am using a drop-down to search a databse collection and display the results in a repaeter on a dynamic page.
I am able to use the code below for searching single word names such as “Japan” successfully.
However, if the country’s name is two or more words such as “New Zealand”, only “New” get searched and generates and error. I have a feeling it is a simple solution but I have given it a lot of tries. Help appreciated.
export function dropdown_change(event) {
// Runs a query on the “countries” collection
wixData.query(“countries”)
// Query the collection for any items whose “Name” field contains
// the value the user selected in the dropdown
.contains(“country”, $w(“#dropdown”).value)
.find() // Run the query
.then(res => {
// Set the table data to be the results of the query
let target = $w(“#dropdown”).value;
wixLocation.to(‘/Country/’+ target) //
});
}
Thank you