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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:18:07+00:00 2026-06-02T10:18:07+00:00

Firstly, I apologise if this is a really simple question to those with more

  • 0

Firstly, I apologise if this is a really simple question to those with more experience, but I’m a little to new to this so I hope someone may be able to help me please.

I’m trying to implement a jQuery Modal Confirmation box upon a button click. This shown in the script below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Gallery</title> 
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
  <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/smoothness/jquery-ui.css">
  <link href="Libraries/fancybox/jquery.fancybox-1.3.1.css" rel="stylesheet" type="text/css"/> 
  <link href="Styles/style.css" rel="stylesheet" type="text/css" />
  <!--[if IE]>   
  <link href="Styles/ie.css" rel="stylesheet" type="text/css" /> 
  <![endif]-->
  <script src="Libraries/jquery/jquery-1.4.3.min.js" type="text/javascript"></script> 
  <script src="Libraries/fancybox/jquery.fancybox-1.3.1.pack.js" type="text/javascript"></script> 
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript"></script>     
  <script type="text/javascript">

  $(function() { $('a.fancybox').fancybox(); }); 

  </script> 

  <script type="text/javascript">
var deleteTheSelectedUrl = '';
$(document).ready(function() {
    // create the jQuery modal window and set autoOpen to false
    $("#jQueryDeleteConfirmationModalWindow").dialog({
        title: "Delete Confirmation",
        autoOpen: false,    // set this to false so we can manually open it
        dialogClass: "jQueryDeleteConfirmationModalWindow",
        closeOnEscape: false,
        draggable: false,
        width: 460,
        height: 260,
        modal: true,
        buttons: {
                "Yes, I'm sure": function() {
                    $( this ).dialog( "close" );
                    if('' != jQuery.trim(deleteTheSelectedUrl)) {
                        window.location = deleteTheSelectedUrl;
                    }
                },
                Cancel: function() {
                    $( this ).dialog( "close" );
                }
            },
        resizable: false,
        open: function() {
            // scrollbar fix for IE
            $('body').css('overflow','hidden');
        },
        close: function() {
            // reset overflow
            $('body').css('overflow','auto');
        }
    }); // end of dialog

    // bind the loading screen to each delete link, assuming you have some kind of way to select them via jQuery
    jQuery('a.deleteConfirmation').click(function() {
        deleteTheSelectedUrl = $(this).attr('href');
        var name = $(this).parent().parent().children('td.name').html(); // a.delete -> td -> tr -> td.name
        name = jQuery.trim(name);
        $("#jQueryDeleteConfirmationModalWindow").html('Are you sure you wish to delete ' + name + '?');
        $("#jQueryDeleteConfirmationModalWindow").dialog('open');
        return false;
    });

});
</script>
  <style type="text/css">
<!--
.style1 {
    font-size: 14px;
    margin-right: 110px;
}
.style4 {font-size: 12px}
-->
  </style>
</head>
<body style="font-family: Calibri; color:  #505050; font-size: 9px; border-bottom-width: thin; margin-top: 5px; margin-left: -476px; margin-right: 1px; margin-bottom: -10px;">
<div align="right" class="style1"> <a href = "javascript:document.gallery.submit()"/> Add Images <a/> &larr; View Uploaded Images </div>
  <form id="gallery" name="gallery" class="page" action="index.php" method="post">  
  <div id="container"> 
    <div id="center"> 
      <div class="aB"> 
        <div class="aB-B"> 
          <?php if ('Uploaded files' != $current['title']) :?>
          <?php endif;?>
          <div class="demo"> 
          <input name="username" type="hidden" id="username" value="IRHM73" />
          <input name="locationid" type="hidden" id="locationid" value="1" />
          <div class="inner"> 
              <div class="container"> 
                <div class="gallery"> 
                  <ul class="gallery-image-list"> 
                  <input type="button" name="deleteimage" value="Delete Selected Image" onclick="jQueryDeleteConfirmationModalWindow"/>
                  <?php for ($i = 0; $i < $descriptions->documentElement->childNodes->length; $i++) : 
                          $xmlFile = $descriptions->documentElement->childNodes->item($i); 
                          $name = htmlentities($xmlFile->getAttribute('originalname'), ENT_COMPAT, 'UTF-8'); 
                          $description = htmlentities($xmlFile->getAttribute('description'), ENT_COMPAT, 'UTF-8'); 
                          //$folder = htmlentities($xmlFile->getAttribute('folder'), ENT_COMPAT, 'UTF-8'); 
                          $source = $galleryPath . rawurlencode($xmlFile->getAttribute('source')); 
                          $thumbnail = $galleryPath . rawurlencode($xmlFile->getAttribute('thumbnail')); 
                  ?>
                    <li class="item"> 
                      <a class="fancybox" target="_blank" rel="original" href="<?php echo $source; ?>"><img class="preview" 
                        alt="<?php echo $name; ?>"  src="<?php echo $thumbnail; ?>" /></a><input type="radio" name="delete" /></li>
                        <p><span class="style4"><b>Image Name:</b> <?php echo htmlentities($xmlFile->getAttribute('originalname'));?> <br />
                          <b>Image Description:</b> <?php echo htmlentities($xmlFile->getAttribute('description'));?> </span><br />  
                          <?php endfor; ?>
                          </li>
                        </p>
                  </ul>
                </div> 
        </div> 
      </div> 
    </div> 
    </div> 
      </div> 
    </div> 
  </div> 
  </form> 
</body> 
</html>

The problem I’m having, is that when I click the ‘Delete Selected Image’ button, I receive this error:'jQueryDeleteConfirmationModalWindow' is undefined at line 92 which is this

<form id="gallery" name="gallery" class="page" action="index.php" method="post">

I’ve rebuilt the page a few times, but I still get the same error, but I’m not sure why.

I just wondered whether someone could have a look at this please and let me know where I’m going wrong?

Thanks and regards

  • 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-02T10:18:11+00:00Added an answer on June 2, 2026 at 10:18 am

    I don’t see a div with the ID jQueryDeleteConfirmationModalWindow. Perhaps I am missing it? The jQuery Dialog is performed on an existing div.

    http://jqueryui.com/demos/dialog/

    <div id="jQueryDeleteConfirmationModalWindow">ARE YOU SURE???</div>
    

    Your onlclick event handler should call a function name

    <input type="button" onclick="showDialog()" ... />
    

    then your JS will access it this way

    function showDialog(){
        $("#jQueryDeleteConfirmationModalWindow").dialog({...});
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly, I'm new to Android (so I apologize if this question is ignorant) but
Firstly apologies if this is really simple but I have spent hours trying and
Firstly, I apologise if this is a dupe - I suspect it may be
Firstly, I do not have any malicious intent out of this question. I would
I am new to this, so I apologise if I am not completely clear...
Firstly, sorry about the question title, it may not be very descriptive for my
firstly, I very much apologize for my poorly written title of this question. So
Firstly I realise that this is a familiar question, it seems to pop up
Firstly, this is a homework assignment, and I am very new to programming in
Firstly apologies if this a very basic question, I'm just curious to know the

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.