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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:38:45+00:00 2026-05-23T17:38:45+00:00

I am using a function to display a dialog box that asks the users

  • 0

I am using a function to display a dialog box that asks the users if their checks printed ok, if so, we update a flag in the database for the checks. I pass this function a “checked_id” which is a value that contains the id of the checks to update.

This code works fine the first time it runs, but when I click on another check to print “checked_id” is the same value as the previously executed id. Furthermore, the id never gets changed, unless I refresh the browser, which I don’t want to have to do every time.

I have verified through firebug that the “checked_id” is actually being changed when calling the function, but something inside the jquery (im guessing) or this function is not clearing out the prevous value in the variable.

How can I fix this? Thanks in advance for any help.

Here is my js function

function confirm_print_checks_yes_no(xtitle,msg, btn_yes_txt, btn_no_txt, checked_id, xwidth, xheight)
{
    var button_yes = btn_yes_txt;
    var button_no = btn_no_txt;
    var dialog_buttons = {};

    xwidth = (xwidth) ? xwidth : 300;
    xheight = (xheight) ? xheight : 150;

    dialog_buttons[button_yes] = function (){   update_existing(checked_id,"xml/xml_update_db.php", "print_checks_div", "SQL_UPDATE_multiple_checks", "update_existing", "", "sql_acctg_checks.php"); $(this).dialog("close");
                                                $(this).dialog("close");

    };
    dialog_buttons[button_no] = function(){$(this).dialog("close");};

    $("#modal_confirm_yes_no").html(msg);
    $("#modal_confirm_yes_no").dialog({
                title: xtitle,
                bgiframe: true,
                autoOpen: false,
                height: xheight,
                width: xwidth,
                modal: true,
                buttons: dialog_buttons
            });

    $("#modal_confirm_yes_no").dialog("open");
}

usage:

onclick="
var checked_ids = getAllCheckedIDs('my_div', 'check_print_chbx');
if(checked_ids)
{
    window.open('print_checks_pdf.php?print_ids=' + checked_ids );
    confirm_print_checks_yes_no(''.mysql_real_escape_string(L_PRINT_CHECKS).', ''.mysql_real_escape_string(L_PRINT_CHECKS_OK_MSG).'', ''.mysql_real_escape_string(L_PRINT_CHECKS_OK_YES_MSG).'', ''.L_NO.'', checked_ids, 500, 200 );
}
else
{
    alert('No Checks Selected')
};"
  • 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-23T17:38:46+00:00Added an answer on May 23, 2026 at 5:38 pm

    For anyone who comes along I figured out that “$(this).dialog(‘destroy’);” instead of “$(this).dialog(‘close’); worked.

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

Sidebar

Related Questions

I'm using jQuery to created a linked TOC that appears in a dialog box.
I am using jquery ui dialog to display form. Unfortunately, this function clears hidden
I'm using the SimpleModal plugin to display a dialog on a site. Within that
I am trying to display a modal Javascript dialog box in Chrome when a
I have div(box) on my page and I'm using this script to display div
I created a page that has a JQuery based dialog using the standard JQuery
I'm trying to create a dialog window using the following CSS: #blackOverlay { display:
I am using jquery datatables to display data from a mysql database. When you
I am added div content into the dialog box using jquery.I am using the
What are the steps to estimating using function points? Is there a quick-reference guide

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.