I am using the Wix website editor. Is there a specific API that can help me with this? I’m trying to send a message with the realtime api by pressing the enter button.
Pratham
December 13, 2023, 6:44am
2
Yes you should be able to do that using the onKeyPress event. Something similar to this:
Not really sure what exactly is going wrong for you, but perhaps the input field is not yet ready to be used by the dataset. You can try a small timeout:
$w("#input8").onKeyPress((event, $w) => {
console.log("keypress: " + event.key);
setTimeout(() => {
if (event.key === "Enter") {
$w("#dataset2").save()
.then(() => {
$w("#text37").show("FadeIn");
});
}
}, 10);
});
I’m really not sure if this will help. Might be worth trying while I shi…