export function postsearch_click(event) {
var userpost = $w(“#postin”).value;
wixData.query(‘Dealer’)
.eq(“postcode”, userpost)
.find()
.then( (results) => {
let items = results.items;
let firstItem = items[0];
$w(“#postout”).value = firstItem.location;
} )
}
If I change the .eq(“postcode”, 3000) it works, I just don’t know how to make the 3000 in this case work with a variable number that is being inserted from a textbox.
Hi,
The input you get from the input component comes as a string.
Is there any chance that ‘postcode’ in your database is a number?
If so, you can just use parseInt function to convert the string to a number: