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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:04:00+00:00 2026-05-24T14:04:00+00:00

buttons : { Ok: function() { $(this).dialog(‘close’); return (typeof callback == ‘string’) ? window.location.href

  • 0
buttons     : {
            Ok: function() {
                $(this).dialog('close');
                return (typeof callback == 'string') ?
                  window.location.href = callback :
                  callback();
            },
            Cancel: function() {
                $(this).dialog('close');
                return false;
            }
        },

For jquery UI, I need to return values the same as a javascript confirm message a 1 and a 0

I assume I do a callback, but unsure how to reference the callback…

EDIT

jsp developer stated that he doesn’t neccessarily need a callback, but needs to be able to do something similar to:

if (answer == true) { 
        //do something 
} 
else { 
        //do something different 
} 

how would I do that?

  • 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-24T14:04:01+00:00Added an answer on May 24, 2026 at 2:04 pm

    You cannot do a return in a jquery dialog.

    What you can do:

    buttons: {
            Ok: function() {
                $(this).dialog('close');
                callback_fn(1);
            },
            Cancel: function() {
                $(this).dialog('close');
                callback_fn(0);
            }
        },
    
    
    //later on:
    function callback_fn(bool){
        //do something with the 1 or 0
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I could only find the function confirm() that gives OK/Cancel buttons. Is there any
i have this function function notify() { alert('oo'); $(#SuccessNotification).dialog({ bgiframe: true, modal: true, title:
var dlg = $(#dialog).dialog({ autoOpen: false, modal: true, buttons: { 'Update': function() { alert(clientCode);
$(#window).dialog({ resizable: true, height: 180, title: titles, width: 500, modal: false, buttons: { OK:
$('.ui-dialog-titlebar-close ui-corner-all').hide(); this is the hide for my Jquery dialog close 'X' span.. this
Here is my code for JQuery UI modal window: $('<p>Message</p>').dialog({ modal: true, buttons: {
I have this jquery code: $(#deletec-box).dialog({ autoOpen: false, resizable: false, height:230, modal: true, buttons:
jquery-ui dialog window in javascript: $( #dialog-confirm ).dialog({ resizable: false, height:140, modal: true, buttons:
My C++ framework has Buttons. A Button derives from Control. So a function accepting
I'm doing this: $(#bcdialog).dialog({ resizable: true, height: 400, width: 600, modal: true, autoOpen: false,

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.