Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Subject: XPage onkeypress event handler - how can I stop form submission?
Feedback Type: Question
Product Area: Domino Designer on Eclipse (DDE)
Technical Area: New Features
Platform: ALL
Release: 8.5
Reproducible: Always

I am trying to set an edit box on an XPage so that, when a user presses the Enter key, the form will not be submitted, but something else will happen instead. I have javascript code that works for this purpose on legacy Domino forms, but seems to be broken on XPages.

For testing, I have a function in a client JS library called "isEnterKey" which returns true if called when the Enter key is pressed, false otherwise.

I have this simple code in the onkeypress event of an edit box:
    if (isEnterKey(thisEvent)) {
    alert('Enter key!');
    return false;
    } else return true;

When tested, it is correctly showing the alert "Enter key!" when (and only when) I press the Enter key in that edit box, but the form is still being submitted. How can I stop the form submission?


Feedback number SLES7RK8D3 created by ~George Umboosicheketsi on 04/29/2009

Status: Closed
Comments: See solution in this response.

XPage onkeypress event handler - ho... (~Bella Zenfooma... 29.Apr.09)
. . SOLVED: use "thisEvent.preventDefau... (~Bella Zenfooma... 1.May.09)
. . Does 'No Data Validation' help? (~Joan Zektoomar... 29.Apr.09)
. . . . 'No data validation' makes no diffe... (~Bella Zenfooma... 30.Apr.09)
. . Pressing Enter on a Edit box should... (~Joan Zektoomar... 30.Apr.09)
. . . . The submission is not caused by an ... (~George Umboosi... 30.Apr.09)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS