Activate action by pressing the enter key on keyboard (input widget)

Hello everyone,

I'm working on a reactive application and on one of my screens I have an input widget. My goal is to trigger an action when the user selects the enter key on the keyboard inside the input widget.

Right now the action is triggered by clicking on the search icon in the input widget (check image below).

Thank you in advance!

Hello Mariana Nunes,

I have made this example:

https://personal-gxzlvs5j.outsystemscloud.com/InputEnter/InputEnter?_ts=637716318380694595

If it works like you need, I attached the OML.

Hope it helps,

Nuno R

InputEnter.oml

Thank you very much for your fast reply, it was exactly what I needed!

Hello.


You can use javascript:


document. addEventListener("keypress" function(e) {

if(e. key === 'Enter') {

var btn = document. querySelector("#submit")

btn. click();

}

});

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.