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

  • Home
  • SEARCH
  • 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 7595051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:34:29+00:00 2026-05-30T21:34:29+00:00

I found a JQuery Alert plugin here, http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/ So I made a sample page

  • 0

I found a JQuery Alert plugin here, http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/
So I made a sample page to test it out but it does not seem to work on Runat=”server” button. The second button is just something I tried to stop the button from posting back and it seems to do that but after confirming, it won’t go anywhere.

I would appreciate any help on this.

<script src="js/jquery.alerts.js" type="text/javascript"></script>
<link href="css/jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
    function confirmThis() {
        jConfirm('Can you confirm this?', 'Confirmation Dialog', function (r) {
            jAlert('Confirmed: ' + r, 'Confirmation Results');
            return r;
        });

        return false;
    }
    $(document).ready(function () {
        $("#btnNext").click(function () {
            jConfirm('Can you confirm this?', 'Confirmation Dialog', function (r) {
                jAlert('Confirmed: ' + r, 'Confirmation Results');
                return r;
            });
        });
    });

</script>
</head>
<body>
<form id="form1" runat="server">
<div>
     <asp:Button ID="btnNext" runat="server" Text="Confirm 1"/>
     <asp:Button ID="Button1" runat="server" Text="Confirm 2" OnClientClick="return    confirmThis();"/>
</div>
</form>
</body>
</html>
  • 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-30T21:34:30+00:00Added an answer on May 30, 2026 at 9:34 pm

    While you should use btnNext.ClientID, that’s not the cause of your problem here. The problem is that the library you are using makes use of callbacks to implement the confirm popup, which means that the function you are attaching to the click event does not wait for the confirm dialog to be clicked before exiting. Since false is not returned from that function, the button click is not cancelled and a postback occurs.

    See the accepted answer here for more information:
    Can you wait for javascript callback?

    One way around this problem is to always return false, and then in the callback from the confirm click the button. Keep in mind you’ll have to unbind the event handler before calling click manually. The following code worked for me:

    $(document).ready(function () {
        $("#<%= btnNext.ClientID %>").bind('click', function () {
            jConfirm('Can you confirm this?', 'Confirmation Dialog', function (r) {
                if (r == true) {
    
                    //Unbind client side click event and submit btnNext
                    $("#<%= btnNext.ClientID %>").unbind('click');
                    $("#<%= btnNext.ClientID %>").click();
                }
            });
    
            //Always prevent a postback by returning false
            return false;
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a image gallery with jQuery found here: http://sarfraznawaz2005.kodingen.com/demos/jquery/image_gallery/ I just wanted
I'm using jquery.history lugin found here: http://tkyk.github.com/jquery-history-plugin/ With this i load content into a
I found that jQuery :odd selector and CSS3 nth-child(odd) works different. http://jsfiddle.net/TMDwT/5/ In yellow
I'm using this tickertype jquery plugin: http://www.hungry-media.com/code/jQuery/tickerType/ And I'm trying to attach a hover
well im using this script right here: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/ and I have a multiMonth plugin
I found this jquery plugin which does exactly what I need, but I want
i found a spotlight plugin for Jquery, but it is not functional in IE.
I'm currently working on a multi-step query form which can be found at: http://jsfiddle.net/xSkgH/47/
I think I found something very weird in JQuery and ASP.NET MVC. As mentioned
I have made my own jQuery plugin, but it has problem that values I

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.