Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6680507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:28:58+00:00 2026-05-26T04:28:58+00:00

I have a simple scenrio in which, Enter key press should trigger the submit

  • 0

I have a simple scenrio in which, Enter key press should trigger the submit on the dialog

Sample code for the dialog

sampleDialog = new YAHOO.widget.Dialog("sampleDialogContent", {
        modal:true,
        draggable:false,
        buttons:[{
            text:"Submit",
            handler: submitHandler,
            isDefault:true
        },{
            text:"Cancel",
            handler: cancelHandler
        }]
    })
var escapeListener = new YAHOO.util.KeyListener(document, {
        keys : [27]
    }, {
        fn:cancelHandler,
        scope:sampleDialog,
        correctScope:true
    } );
escapeListener.enable();

var enterListener = new YAHOO.util.KeyListener(document, {
        keys : [13]
    }, {
        fn:submitHandler,
        scope:sampleDialog,
        correctScope:true
    } );
enterListener.enable();

In the above code Escape key listener works perfectly and Enter key listener does not work. Why?
If I change the key for submitHandler, it works again. Enter key is doing something spl

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:28:59+00:00Added an answer on May 26, 2026 at 4:28 am

    I identified the problem. In the submit handler I have some validation checks that show an alert if data is bad. When I tested I never tested with good data. So I was always hitting those alert boxes. Here comes the problem: for some reason the alert dialog also got the enter key press along with the parent dialog, so the alert dialog is collapsed and net UI effect is as if nothing happened. Now I kill the key event before actually calling the submit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a simple client/server scenario with one method: // client code $client
I have simple scenario in which i hide and show a signle MenuItem in
I have a very simple scenario: My iPhone application contains a UIViewController implementation which
I have a simple solid modeling application in which I want to implement several
I have the following simple test which doesnt return true for some reason. string[]
I have simple SL user control. A listbox which shows all customers and on
I have a simple scenario and a issue with it which I just cant
I have this simple scenario: main.m (which is my main class) myClass.m (which is
I have a scenario, which is seemingly simple on paper, but I'm having trouble
I have a simple scenario. I'd like to create a new instance of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.