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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:41:22+00:00 2026-05-23T13:41:22+00:00

I’m currently using the confirmaction jQuery plugin found here: http://www.webstuffshare.com/2010/03/jquery-plugin-jconfirmaction/ And my question is

  • 0

I’m currently using the confirmaction jQuery plugin found here:

http://www.webstuffshare.com/2010/03/jquery-plugin-jconfirmaction/

And my question is right now I have an icon that calls up the ask dialog box to ask if it wants to confirm the deletion of that one item however I also have a button that once clicked will create an array of values from checkboxes of items the user wants to delete and then confirm the deletion of those items but i’m having trouble dealing with multiple uses on the same page. Any suggestions.

Edit Post:

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

jQuery.fn.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",
        noAnswer: "No"
    }, options);

    return this.each (function () {

        $(this).bind('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="no">'+theOptions.noAnswer+'</span></div>');

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

            $('.yes').bind('click', function(){
                if($('#myhiddenPageToken').val() == "useraccounts"){ useraccounts(this); }
                else if($('#myhiddenPageToken').val() == "someotherpage"){ someotherfunction(); }
                else{/*do nothing*/}
            });

            $('.no').bind('click', function(){
                $(this).parents('.question').fadeOut(300, function() {
                    $(this).remove();
                });
            });

        });

    });
}

})(jQuery);

function useraccounts(whatsThis) { 
var userID =$(whatsThis).parents('td').find('img').attr('id');
var dataString = 'userID=' + userID + '&deleteuser=True'; 
$.ajax({ 
    type: "POST", 
    url: "processes/useraccounts.php", 
    data: dataString, 
});
$(whatsThis).parents("tr").eq(0).hide();    
}


<?php
session_start();
require("../inc/dbconfig.php");
require("../inc/global_functions.php");

// find out how many rows are in the table 
$query = "SELECT CONCAT_WS(' ',firstName,lastName) AS name, username, emailAddress, userID FROM manager_users WHERE statusID != 4";
$result = mysqli_query($dbc,$query);

$fileName = basename($_SERVER['PHP_SELF']);
$pageName = "User Accounts";
$userData = $_SESSION['user_data'];
$userID = $userData['userID'];
?>

<script type="text/javascript">
$(document).ready(function() {

$('#usersPageList').dataTable( {
    "sDom": 'rti<"pagination"p>',
    "iDisplayLength": 10,
    "sPaginationType": "full_numbers",
} );

var info = $('.dataTables_info')
var clone = info.clone();
info.hide();
$('tfoot tr td.rounded-foot-left').append(clone);



$('a.bt_green').click(function(e) {
    e.preventDefault();
    $('div.right_content').load('forms/addnew/' + $(this).attr('id'));
});

$('table tr').click(function() {

    checkBox = $(this).children('td').children('input[type=checkbox]');

    if(checkBox.attr('checked'))
        checkBox.removeAttr('checked');
    else
        checkBox.attr('checked', 'checked');

});

$('.ask').jConfirmAction();

$('.ask2').jConfirmAction();    

});
</script>

<h2>User Accounts</h2> 

<table id="usersPageList" class="rounded-corner">

<thead>

    <tr>

        <th scope="col" class="rounded-first"></th>
        <th scope="col" class="rounded">Name</th>
        <th scope="col" class="rounded">Email Address</th>
        <th scope="col" class="rounded">Username</th>
        <th scope="col" class="rounded">Edit</th>
        <th scope="col" class="rounded-last">Delete</th>

    </tr>

</thead>

<tfoot>

    <tr>

        <td colspan="5" class="rounded-foot-left"></td>
        <td class="rounded-foot-right">&nbsp;</td>

    </tr>

</tfoot>

<tbody>

    <?php 
    while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        echo "<tr>";
            echo "<td><input type=\"checkbox\" name=\"users[]\" value=\"".$row['userID']."\"/></td>";
            echo "<td>".$row['name']."</td>";
            echo "<td>".$row['emailAddress']."</td>";
            echo "<td>".$row['username']."</td>";
            echo "<td><a href=\"#\"><img src=\"images/user_edit.png\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['userID']."\" /></a></td>";
            echo "<td>";
            if (($row['userID'] !== '10000') && ($row['userID'] !== $userID)){
                echo "<a href=\"#\" class=\"ask\"><img src=\"images/trash.png\" class=\"delete\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['userID']."\" /></a>";
            }
            echo "</td>";
        echo "</tr>";
    }
    ?> 

</tbody>

</table>

<?php
addRemove($fileName,$pageName);
?>

<input type="hidden" name="myhiddenPageToken" id="myhiddenPageToken" value="useraccounts" />
  • 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-23T13:41:23+00:00Added an answer on May 23, 2026 at 1:41 pm

    What I would do is give the button a certain class and then copy the content of the ‘each’. Also you could make two ‘theOptions’ so you would have different texts, it’s important to rename the classes ‘yes’ and ‘no’. I’m not really familiar with your code so maybe if you post your HTML i can help you better.

    return this.hasClass('class1').each (function () {
        //the stuff you want to do here
    }
    
    
    return this.hasClass('class2').each (function () {
        //the stuff you want to do here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.