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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:06:21+00:00 2026-05-22T23:06:21+00:00

My issue is relating to dynamically applied elements to a page that I am

  • 0

My issue is relating to dynamically applied elements to a page that I am running a confirm against. The code correctly targets the element and asks the confirmation part, however the problem is if I select Yes, I have no idea where the return value is hidden, it is not set in the class like my thoughts below, nor does it return a value of sorts.

Anyone know how I can get some form of return value from the confirm for the element that I wish to delete?

    $('.deleteMe').live('click', function() {

        confirmFunction(this);
        if ($(this).hasClass('confirm')){ alert("yea");} else {alert("no");}
    });

    function confirmFunction(element) {
        $(element).confirm({
          msg:'Confirm Action!<br />',
          stopAfter:'ok',
          eventType:'click',
          timeout:5000,
          buttons: { ok:'Yes', cancel:'No', separator:' - '}
        });
    }
  • 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-22T23:06:22+00:00Added an answer on May 22, 2026 at 11:06 pm

    From my understanding of the examples on the plug-in page, it should be like this:

    Assign the click handler that should run if confirmation is successful, then assign the confirm plugin.

     $('.deleteMe').live('click',function() {
        // Code here for when they click YES on the confirm box.
        // This only executes in 2 scenarios, either the item was clicked
        //   and the confirm plugin was not active, or it was active and
        //   the user selected Yes.
     });
    
     function updateConfirms() {
        $('.deleteMe').confirm({
          msg:'Confirm Action!<br />',
          stopAfter:'ok',
          eventType:'click',
          timeout:5000,
          buttons: { ok:'Yes', cancel:'No', separator:' - '}
        });
     }
    
     updateConfirms();
    

    Due to the dynamic nature you mentioned, you would need to call updateConfirms() after adding new elements that need confirmations.

    EDIT: Let’s try not using Live, and refreshing the click handler and the confirm after any additions:

     function updateConfirms() {
       $('.deleteMe').click(function() {
        // Code here for when they click YES on the confirm box.
        // This only executes in 2 scenarios, either the item was clicked
        //   and the confirm plugin was not active, or it was active and
        //   the user selected Yes.
       });
    
       $('.deleteMe').confirm({
         msg:'Confirm Action!<br />',
         stopAfter:'ok',
         eventType:'click',
         timeout:5000,
         buttons: { ok:'Yes', cancel:'No', separator:' - '}
       });
     }
    
     updateConfirms();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Due to an issue relating to a horrible mobile device (that work has given
I have a strange issue, relating to running a BASH script via cron (invoked
This is a follow up issue relating to the answer for SQL placeholder in
The issue that prompted me to ask this is a web form that was
another issue in IE 6... link The navbar link list has a border applied
Our issue is that our project has files being downloaded using wget to the
I realise that there are many existing questions regarding this issue, but I haven't
I am investigating an issue relating to a large log expansion during an ETL
Ok, I have a question relating to an issue I've previously had. I know
I'm have an issue with this entity query that I am hoping to get

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.