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 8685893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:41:39+00:00 2026-06-12T22:41:39+00:00

I have a jQuery confirmation dialog that does not fire the event associated with

  • 0

I have a jQuery confirmation dialog that does not fire the event associated with the default button when the user presses Enter; when I use the mouse, the button behaves as expected.

The default button (‘Cancel’) does highlight when I press enter, but nothing else happens.

This is the dialog:

enter image description here

And here is the code that produces the above dialog:

$(document).ready(function () {

    $('#m_btnNext').click(function (e) {
            var my_messages = 'warning';
            if (my_messages.length > 0) {
                e.preventDefault();
                $('#dialog-confirm-withdraw').html(my_messages);
                $("#dialog-confirm-withdraw").dialog("open");
                return false;
            }
            return true;    
            });

        var cascadeConfirmWithdrawMarkup = "<div id='dialog-confirm-withdraw' title='Withdraw'><p>Set on build</p></div>";
        $(cascadeConfirmWithdrawMarkup).appendTo('body').hide();

        $('#dialog-confirm-withdraw').dialog({ title: '<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Withdraw Warnings',
            width: 400,
            height: 175,
            resizable: false,
            draggable: false,
            modal: true,
            autoOpen: false,
            open: function () {
                $('.ui-dialog-buttonpane button:eq(1)').focus();
            },
            buttons: {
                "Proceed with withdraw": function () {
                    $(this).dialog("close");
                },
                "Cancel": function () {
                    $(this).dialog("close");
                }
            }
        });
});

In its simplest form, this code works fine, but I am having tremendous difficulty pinpointing the culprit in my real form.

I commented out all other javascript so only the above code exists; no errors are logged to the console; yet nothing happens.

If there’s not an obvious error in my js above, what is the best way to find the needle in this haystack?

Masochists can download the full html page (with all javascript), here. I used FF’s Save As “Web Page, Complete” to create that zip.

Bear in mind that I am only adding functionality to this form; I did not create it.

  • 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-06-12T22:41:41+00:00Added an answer on June 12, 2026 at 10:41 pm

    In halcyonCommon.js you have a function called KeyListener() which is called on document load. That function adds an event listener for keydown, and it appears to be handling escape and enter keydown events for your whole document:

            case KeyCode.Enter:             
                if (el.tagName == "INPUT") {                    
                    switch (el.type) {
                        case "checkbox" :
                        case "password" :
                        case "radio" :
                        case "text" : 
                            {   //Check for datebox and timebox, has controller --> onblur before click OK
                                if (el.Controller && el.Controller.onblur)
                                    el.Controller.onblur({target : el});
    
                                return oThis.clickAction(oThis._DefaultButton, e); 
                            }
                        break;                      
                        case "file" ://ThamHNguyen, added 14-NOV-06
                            return oThis.clickAction(oThis._DefaultButton, e);
                            break;
    
                        default:
                            return true;
                    }
                } else if (el.tagName == "SELECT") {
                    return oThis.clickAction(oThis._DefaultButton, e);              
                } else if (el.tagName == "HTML" || el.tagName == "BODY" || el.tagName == "TD") { //"TD" : on IE only
                    return oThis.clickAction(oThis._DefaultButton, e);              
                } else if (el.tagName == "TEXTAREA" || el.tagName == "A" ) {
                    return true;
                } else {
                    return false; //Prevent default button of IE
                }
    

    See the last else case? Removing that solves the problem, but it’s possible that this will cause undesired behavior elsewhere in your program. If it does, you’ll need to add a third possible occasion for returning true (and therefore allowing normal behavior) in this line:

    } else if (el.tagName == "TEXTAREA" || el.tagName == "A" )
    

    For example:

    } else if (el.tagName == "TEXTAREA" || el.tagName == "A" || el.tagName == "SPAN" )
    

    …though that may not be specific enough.

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

Sidebar

Related Questions

I have a confirmation dialog in jquery that pops up and show some confirmation
I have a jQuery dialog that pops up and allows the user to send
I have a requirement to show a custom modal jQuery confirmation when a user
In my Rails 3.1 application I have a Jquery dialog that pops up when
I have a link that its href is set.I 've assigned jQuery ui dialog
I have the following code that simply uses a jquery ui modal dialog to
I have a very basic confirmation dialog that have 2 buttons:Ok & Cancel. Here
I have JQuery UI Dialog opening on pressing CTRL + Q using the following
I have jquery ui dialog box, and I want to resize it by the
I have jQuery to select all font elements that are children of the element

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.