[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

Avoid submit when pressing enter

Something easy i think, but i wanted to know some solutions on how people avoid this situation.
In my application i use a dialogbox to allow my user to enter some comments about the topic.
The dialogbox consists of OK and Cancel and an input form with multiple lines.

Now when the user presses Enter the form was being submitted instead of a new line in the input box ( CTRL + enter )
I solved it by doing a validation in my Save event.

Does anyone have another perhaps easier solution for this ?
  • 2
  • 2
1 Solution
In the (layout region) forms propertybox, 2nd tab, select "Allow multiple lines".
You can user ENTER now.... no need to use CTRL + ENTER.
I'm confused... web or Notes client?

In Notes, normally pressing enter in a field gives you a new line.  The only exception Ican thing of is when you use a field within a layout region, and in that case, it would close the dialog box even if you pressed control-enter.  I conclude this isn't a Notes client problem.

So, I assume that the problem occur on the web, not in Notes.  Enter as submit on the web is a function of the browser design, not Domino.  If you are in an input object, pressing enter will effetively click the submit button in many cases.  However, when that is the case, control-enter has absoluetly no effect -- it is ignored by the browser.  So, I conclude this is not a browser problem.

Wait, then what is it?  Imust be missing something here... please describe exactly what you built, and how you access it.

Note: The browser enter-as-submit only occurs in input objects, not textarea objects.  Dmino generates input objects for most fields, but there are some exceptions.

Note: Don't know what CRAK's talking about, haven't seen a chekcbox "Allow multiple lines"
Wait, never mind, I remember what CRAK's talking baout.  If you use "Native OS style" fields instead of Notes-style fields on teh Notes lcient, thne you get the option to allow multiple lines in a field or to not allow it (that's on the FIELD properties box, second tab).  If you "don't allow" multiple lines, control-enter bypasses that (bad Iris, bad), and pressing enter in a such a field passes the ENTER-KEY even from the field to the dialog, which treats it as an OK request.

So, CRAK's right, except he's on crack about which properties box affects this :)
Who's on crack? Watch your or I'll report you to the PE for flaming! <GRIN>

I just forgot to mention: its a property of the FIELD on the form holding the layout region.
Looking for it in the form's properties is indeed a waste of time!
Pure quality, qwalitee!
Consider your own response "If you use "Native OS style" fields instead of Notes-style fields ...".
Our mission was a dialogbox.... ergo: a layout region. Is there a notes style field available in a layout region?

Sorry mate, couldn't resist. Let's blame it on monday! ;-))

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now