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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:55:43+00:00 2026-05-17T06:55:43+00:00

I have a application with many dialogs and created a function to open a

  • 0

I have a application with many dialogs and created a function to open a dialog and also load data into it, so other functions could open a dialog and process the users option.

The problem is when I call openDialog it stops the function that called it. I thought by adding a return value so when a button is clicked the calling function can process the users response.

function customer_crud(op)
{
var formData = $("#customer_details_form").serialize();
var debugData = formData.replace(/&/g,'<br />');

var text = "<p>Customer Function: " + op + "</p><p>" + debugData + "</p>";
if(openDialog('DEBUG', text)){
    alert("TRUE");
} else {
    alert("FALSE");
}

}

function openDialog(title, text) {

   var dialogOpts = {
    title: title,
    modal: true,
    autoOpen: false,
    buttons: {
              "Delete all items": function() {
                $( this ).dialog( "close" );
                return true;
            },
            Cancel: function() {
                $( this ).dialog( "close" );
                return false
            }
    }

    };

    $("#dialog").dialog(dialogOpts);

    $("#dialog").html(text).dialog('open');

}

The above code opens the dialog but throws false before anything is selected. If someone could please help me or sugguest a better way I would be greatful.

I plan to pass dialogOpts to the function but placed it in there for testing.

Thanks

  • 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-17T06:55:44+00:00Added an answer on May 17, 2026 at 6:55 am

    I have a single dialog that can be called from multiple buttons. Only one step in the process changes depending on which button is pushed. The result of the dialog goes into a different field depending on the button. So, I set a variable in the click function before calling the dialog. Then, in my dialog, I have a switch statement which checks the variable and adds the value to the appropriate field. You could similarly use a switch statement to do the different functionality depending on which dialog you’re calling.

    function openDialog(title, text) {
      var dialogOpts = {
        title: title,
        modal: true,
        autoOpen: false,
        buttons: {
          "Delete all items": function() {
            switch (item_type) {
                                        case "primary":
                                            ...
                                            break;
                                        case "insurance":
                                            ...
                                            break;
                                        case "safety":
                                            ...
                                            break;
                                        case "sales":
                                            ...
                                            break;
                                    }
                                    $(this).dialog('close');
          },
          Cancel: function() {
            $(this).dialog("close");
          }
        }
      };
      $("#dialog").dialog(dialogOpts)
                 .html(text).dialog('open');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a RIA application where i have used many and many dialogs
I have an application that has many different types of objects that each persist
I have an application where I have potentially many processes must send a message
I imagine there are many of you out there who have developed an application
We have a project with many dll files which get loaded when the application
I have inherited a VB6/Access application that we have developed and sold for many
I have a legacy VB6 application that was built using MSDE. As many client's
When designing an application, does there come a point where you have too many
Many applications have grids that display data from a database table one page at
I have a GUI application which can create many similar windows on desktop. All

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.