Hi,
Is it possible once a user paste something into an input and it triggers a query immediately without having to click enter or a button? I tried onFocus event but seems to not work.
export function pinInput_onFocus(event) {
$w('#verifyText').text = "Looking for your pin..."
if (!event.key === "v"&&!event.ctrlKey) {
wixData.query("verify") // query for pin
.eq("pin", $w('#pinInput').value
.find()
.then((result) =>{
if (result.items.length === 1) {
let items = result.items //if pin is found and it is one only
let item = items[0]
let id = item._id
wixData.get("verify", id)
.then((item) => {
item.verified = true; //bool
item.pin = ""; //remove pin as it is verified
wixData.update("verify", item)
$w('#verifyText').text = "Your email has been verified!"
})
} else {
if (result.items.length > 1) {
$w('#verifyText').text = "Sorry, something went wrong. We will contact you"
wixData.get("verify", id)
.then((item) => {
item.adminError= true; //bool
wixData.update("verify", item)
}
if (result.items.length === 0) {
$w('#verifyText').text = "Sorry mate, I can't find this pin"
}
}
})
}
})
I also want this to work on mobile as well for customer impression
Thanks in advance!