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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:55:30+00:00 2026-05-24T05:55:30+00:00

Can someone point out to me how to make the ask class into a

  • 0

Can someone point out to me how to make the ask class into a live click event.

$('.ask').jConfirmAction( {
    question : "Are you sure you want to delete the selected row?", 
    yesAnswer : "Yes", 
    cancelAnswer : "No", 
    onYes: function(evt) { 
      contentpages(evt.target); 
    }
});

Unless its on this page:

 /*
 * jQuery Plugin : jConfirmAction
 * 
 * by Hidayat Sagita
 * http://www.webstuffshare.com
 * Licensed Under GPL version 2 license.
 *
 */
(function($){

jQuery.fn.jConfirmAction = function (options) {
    var theOptions = jQuery.extend( {
        question: "Are You Sure ?",
        yesAnswer: "Yes",
        cancelAnswer: "Cancel",
        questionClass: "question",
        yesClass: "yes",
        cancelClass: "no",
        onYes: function() {}   // for specifying a function to call when the "yes" button is clicked
    }, options );

    return this.each( function() {

        $(this).bind('click', function(e) {
            e.preventDefault();

            if($(this).next('.' + theOptions.questionClass).length <= 0) {
                $(this).after('<div class="' + theOptions.questionClass + '">'+theOptions.question+'<br/><span class="' + theOptions.yesClass + '">'+theOptions.yesAnswer+'</span><span class="' + theOptions.cancelClass + '">'+theOptions.cancelAnswer+'</span></div>');

                $( '.' + theOptions.yesClass ).bind('click', function( evt ) {
                    theOptions.onYes( evt );
                    $(this).parents( '.' + theOptions.questionClass ).fadeOut( 300, function() {
                        $(this).remove();
                    } );
                });

                $( '.' + theOptions.cancelClass ).bind('click', function(){
                    $(this).parents( '.' + theOptions.questionClass ).fadeOut( 300, function() {
                        $(this).remove();
                    } );
                });
            }

            $(this).next( '.' + theOptions.questionClass ).animate( { opacity: 1 }, 300 );
        });

    } );
}

})(jQuery);
  • 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-24T05:55:32+00:00Added an answer on May 24, 2026 at 5:55 am

    If you do not want to change the code for the plugin simply initialise it after you put “.ask” elements in the page. e.g.

    $("<div class='ask'>Ask me</div>").appendTo(".container").jConfirmAction({...});
    

    If you want the plugin to register events on non existant elements you need to modify it to take a selector name as a parameter and generally registering the live event – this is a quick and dirty way

    /*
     * jQuery Plugin : jConfirmAction
     * 
     * by Hidayat Sagita
     * http://www.webstuffshare.com
     * Licensed Under GPL version 2 license.
     *
     */
    (function($){
    
     $.extend({
            jConfirmAction: function (options) {
                    // Some jConfirmAction options (limited to customize language) :
            // question : a text for your question.
            // yesAnswer : a text for Yes answer.
            // cancelAnswer : a text for Cancel/No answer.
            var theOptions = jQuery.extend ({
                question: "Are You Sure ?",
                yesAnswer: "Yes",
                cancelAnswer: "Cancel",
                targetSelector : ".sample_selector"
            }, options);
    
    
                $(theOptions.targetSelector).live('click', function(e) {
    
                    e.preventDefault();
                    thisHref    = $(this).attr('href');
    
                    if($(this).next('.question').length <= 0)
                        $(this).after('<div class="question">'+theOptions.question+'<br/> <span class="yes">'+theOptions.yesAnswer+'</span><span class="cancel">'+theOptions.cancelAnswer+'</span></div>');
    
                    $(this).next('.question').animate({opacity: 1}, 300);
    
                    $('.yes').bind('click', function(){
                        window.location = thisHref;
                    });
    
                    $('.cancel').bind('click', function(){
                        $(this).parents('.question').fadeOut(300, function() {
                            $(this).remove();
                        });
                    });
    
                });
            }
        });
    
    
    
    
    })(jQuery);
    

    and you initialise it like so

            $(document).ready(function() {
    
        //specify what selector you want - all the other options still work     
        $.jConfirmAction({targetSelector: ".sample_selector"});
    
    //add an element
                    $("<div class='sample_selector'>Ask me</div>").appendTo("#container");
    
    
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone point out a couple of good quality tutorials/pages for donut caching? Like
it's assembler right? can someone please point out the progression that we've had in
Could someone please point out a site where I can find an algorithm to
I'm staring blank on this error, so I hope someone here can point out
Can someone point me in the right direction? I wish to distribute a WCF
Can someone point me to a public domain (or MIT- or BSD-license) library for
Can someone point me to an article (or discuss here) that explains how an
Can someone point me to videos/blogs/instructions on using Web Testing in Visual Studio 2008
Can someone point me to an article that shows the dropdownlist being populated from
Can someone point me to some tutorial on how to set up a ping

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.