Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Capture 'Enter' key event

Avatar

Former Community Member
Hi,



Is there any way we can capture the event when a user presses the enter key inside a text field?
4 Replies

Avatar

Former Community Member
Hi andrewquay



you can capture the enter key by adding the following code in the textfield's change event.



if(xfa.event.change == "\u000a")

{

xfa.host.messageBox("enter key is pressed");

}



mail: Ashok5.k@tcs.com

Avatar

Former Community Member
Hi Ashok,



Thanks for your help. Our problem is that we have a single line text field, so when we press the enter key the change event is not triggered. Any other way around this? Thanks again..



Andrew