Avoid submit when pressing enter

Posted on 2004-11-21
Last Modified: 2013-12-18

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 ?
Question by:Steamer
    LVL 13

    Accepted Solution

    In the (layout region) forms propertybox, 2nd tab, select "Allow multiple lines".
    You can user ENTER now.... no need to use CTRL + ENTER.
    LVL 31

    Expert Comment

    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"
    LVL 31

    Expert Comment

    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 :)
    LVL 13

    Expert Comment

    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

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Lotus notes 3 285
    IBM Lotus notes 9 76
    Why the url within notes is no action 6 36
    Lotus Notes Calendar Help 6 81
    For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
    Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now